From 69bee82b81626b82b7f39f0e459e4f56b1699b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:02:16 +0800 Subject: [PATCH] 正式数据库修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java index ddf7664..79ff506 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java @@ -53,6 +53,13 @@ return systemClientParamsDao.list("from SystemClientParams scp where scp.system.id=?", new Serializable[] { id }); } + + @Cacheable(value = "clientParamCache", key = "#id+'-'+#version") + public List<SystemClientParams> getSystemClientParamsBySystemId(long id,int version) { + + return systemClientParamsDao.list("from SystemClientParams scp where scp.system.id=?", + new Serializable[] { id }); + } public List<SystemClientParamsAdmin> getAdminList(System system, String key) { List<SystemClientParams> list; @@ -313,12 +320,12 @@ if (StringUtil.isNullOrEmpty(key)) { list = systemClientParamsDao.list("from SystemClientParams scp where scp.system.id = ? ", - new Serializable[] {systemId}); + start, count, new Serializable[] {systemId}); } else { list = systemClientParamsDao.list( "from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)", - new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"}); + start, count, new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"}); } } @@ -332,21 +339,21 @@ if (systemId == null) { if (StringUtil.isNullOrEmpty(key)) { - return systemClientParamsDao.getCount("from SystemClientParams scp"); + return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp"); } else { - return systemClientParamsDao.getCount("from SystemClientParams scp where (scp.name like ? or scp.key like ?) ", + return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp where (scp.name like ? or scp.key like ?) ", new Serializable[] { "%" + key + "%" ,"%" + key + "%"}); } } else { if (StringUtil.isNullOrEmpty(key)) { - return systemClientParamsDao.getCount("from SystemClientParams scp where scp.system.id = ? ", + return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp where scp.system.id = ? ", new Serializable[] {systemId}); } else { return systemClientParamsDao.getCount( - "from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)", + " select count(id) from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)", new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"}); } } @@ -355,6 +362,7 @@ @Transactional + @Override public void saveAdd(SystemClientParams scp, List<Long> listId) throws Exception { if (listId == null || listId.size() == 0) { -- Gitblit v1.8.0