增加平台配置的操作接口

This commit is contained in:
季圣华
2021-12-09 00:43:45 +08:00
parent d0fe0f3578
commit a1e59e8b3e
6 changed files with 64 additions and 28 deletions

View File

@@ -9,11 +9,11 @@ import java.util.List;
public interface PlatformConfigMapperEx {
List<PlatformConfig> selectByConditionPlatformConfig(
@Param("key") String key,
@Param("platformKey") String platformKey,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByPlatformConfig(
@Param("key") String key);
@Param("platformKey") String platformKey);
}

View File

@@ -31,35 +31,35 @@ public class PlatformConfigComponent implements ICommonQuery {
private List<?> getPlatformConfigList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String key = StringUtil.getInfo(search, "key");
return platformConfigService.select(key, QueryUtils.offset(map), QueryUtils.rows(map));
String platformKey = StringUtil.getInfo(search, "platformKey");
return platformConfigService.select(platformKey, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String key = StringUtil.getInfo(search, "key");
return platformConfigService.countPlatformConfig(key);
String platformKey = StringUtil.getInfo(search, "platformKey");
return platformConfigService.countPlatformConfig(platformKey);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return platformConfigService.insertSystemConfig(obj, request);
return platformConfigService.insertPlatformConfig(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return platformConfigService.updateSystemConfig(obj, request);
return platformConfigService.updatePlatformConfig(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return platformConfigService.deleteSystemConfig(id, request);
return platformConfigService.deletePlatformConfig(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return platformConfigService.batchDeleteSystemConfig(ids, request);
return platformConfigService.batchDeletePlatformConfig(ids, request);
}
@Override

View File

@@ -48,20 +48,20 @@ public class PlatformConfigService {
return list;
}
public List<PlatformConfig> select(String key, int offset, int rows)throws Exception {
public List<PlatformConfig> select(String platformKey, int offset, int rows)throws Exception {
List<PlatformConfig> list=null;
try{
list=platformConfigMapperEx.selectByConditionPlatformConfig(key, offset, rows);
list=platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countPlatformConfig(String key)throws Exception {
public Long countPlatformConfig(String platformKey)throws Exception {
Long result=null;
try{
result=platformConfigMapperEx.countsByPlatformConfig(key);
result=platformConfigMapperEx.countsByPlatformConfig(platformKey);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -69,7 +69,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{
public int insertPlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{
PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class);
int result=0;
try{
@@ -81,7 +81,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateSystemConfig(JSONObject obj, HttpServletRequest request) throws Exception{
public int updatePlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{
PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class);
int result=0;
try{
@@ -93,7 +93,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteSystemConfig(Long id, HttpServletRequest request)throws Exception {
public int deletePlatformConfig(Long id, HttpServletRequest request)throws Exception {
int result=0;
try{
result=platformConfigMapper.deleteByPrimaryKey(id);
@@ -104,7 +104,7 @@ public class PlatformConfigService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSystemConfig(String ids, HttpServletRequest request)throws Exception {
public int batchDeletePlatformConfig(String ids, HttpServletRequest request)throws Exception {
List<Long> idList = StringUtil.strToLongList(ids);
PlatformConfigExample example = new PlatformConfigExample();
example.createCriteria().andIdIn(idList);

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.PlatformConfigMapperEx">
<select id="selectByConditionPlatformConfig" parameterType="com.jsh.erp.datasource.entities.PlatformConfigExample" resultMap="com.jsh.erp.datasource.mappers.PlatformConfigMapper.BaseResultMap">
select *
FROM jsh_platform_config
where 1=1
and platform_key!='activation_code'
<if test="platformKey != null and platformKey != ''">
<bind name="bindKey" value="'%'+platformKey+'%'"/>
and platform_key like #{bindKey}
</if>
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByPlatformConfig" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_platform_config
WHERE 1=1
and platform_key!='activation_code'
<if test="platformKey != null and platformKey != ''">
<bind name="bindKey" value="'%'+platformKey+'%'"/>
and platform_key like #{bindKey}
</if>
</select>
</mapper>