数据字典列表查询修改,待验证

This commit is contained in:
weizhiqiang 2022-09-30 18:02:10 +08:00
parent 7be0fe3208
commit 4f90e1e906
6 changed files with 34 additions and 26 deletions

View file

@ -14,6 +14,7 @@ import com.skyeye.common.util.ToolUtil;
import com.skyeye.eve.dao.CodeModelGroupDao;
import com.skyeye.eve.entity.codedoc.group.CodeModelGroupQueryDo;
import com.skyeye.eve.service.CodeModelGroupService;
import com.skyeye.eve.service.IAuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -41,6 +42,9 @@ public class CodeModelGroupServiceImpl implements CodeModelGroupService {
@Value("${jdbc.database.name}")
private String dbName;
@Autowired
private IAuthUserService iAuthUserService;
/**
* 获取模板分组列表
*
@ -52,6 +56,8 @@ public class CodeModelGroupServiceImpl implements CodeModelGroupService {
CodeModelGroupQueryDo codeModelGroupQuery = inputObject.getParams(CodeModelGroupQueryDo.class);
Page pages = PageHelper.startPage(codeModelGroupQuery.getPage(), codeModelGroupQuery.getLimit());
List<Map<String, Object>> beans = codeModelGroupDao.queryCodeModelGroupList(codeModelGroupQuery);
iAuthUserService.setNameByIdList(beans, "createId", "createName");
iAuthUserService.setNameByIdList(beans, "lastUpdateId", "lastUpdateName");
outputObject.setBeans(beans);
outputObject.settotal(pages.getTotal());
}

View file

@ -13,6 +13,7 @@ import com.skyeye.common.util.DateUtil;
import com.skyeye.eve.dao.CodeModelDao;
import com.skyeye.eve.entity.codedoc.model.CodeModelQueryDo;
import com.skyeye.eve.service.CodeModelService;
import com.skyeye.eve.service.IAuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -35,6 +36,9 @@ public class CodeModelServiceImpl implements CodeModelService {
@Autowired
private CodeModelDao codeModelDao;
@Autowired
private IAuthUserService iAuthUserService;
/**
* 获取模板列表
*
@ -46,6 +50,8 @@ public class CodeModelServiceImpl implements CodeModelService {
CodeModelQueryDo codeModelQuery = inputObject.getParams(CodeModelQueryDo.class);
Page pages = PageHelper.startPage(codeModelQuery.getPage(), codeModelQuery.getLimit());
List<Map<String, Object>> beans = codeModelDao.queryCodeModelList(codeModelQuery);
iAuthUserService.setNameByIdList(beans, "createId", "createName");
iAuthUserService.setNameByIdList(beans, "lastUpdateId", "lastUpdateName");
outputObject.setBeans(beans);
outputObject.settotal(pages.getTotal());
}

View file

@ -8,16 +8,14 @@
a.group_name groupName,
a.group_num groupNum,
a.group_desc groupDesc,
CONCAT_WS('_', d.job_number, d.user_name) createName,
a.create_id createId,
CONVERT(a.create_time, char) createTime,
CONCAT_WS('_', e.job_number, e.user_name) lastUpdateName,
a.last_update_id lastUpdateId,
CONVERT(a.last_update_time, char) lastUpdateTime,
(SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum,
(SELECT COUNT(*) FROM (SELECT COUNT(*), c.group_id FROM code_model_history c GROUP BY c.file_path) d WHERE d.group_id = a.id) useNum
FROM
code_model_group a
LEFT JOIN sys_eve_user_staff d ON a.create_id = d.user_id
LEFT JOIN sys_eve_user_staff e ON a.last_update_id = e.user_id
<where>
<if test="groupName != '' and groupName != null">
AND a.group_name LIKE '%${groupName}%'
@ -52,16 +50,14 @@
COUNT(*) modelNum
FROM
code_model b
WHERE
b.group_id = #{id}
WHERE b.group_id = #{id}
</select>
<delete id="deleteCodeModelGroupById" parameterType="java.util.Map">
DELETE
FROM
code_model_group
WHERE
id = #{id}
WHERE id = #{id}
</delete>
<select id="queryCodeModelGroupMationToEditById" parameterType="java.util.Map" resultType="java.util.Map">
@ -81,7 +77,7 @@
FROM
code_model_group a
WHERE a.id != #{id}
AND a.group_name = #{groupName}
AND a.group_name = #{groupName}
</select>
<update id="editCodeModelGroupMationById" parameterType="java.util.Map">
@ -112,7 +108,7 @@
b.TABLE_COMMENT AS tableComment
FROM
information_schema.COLUMNS a
LEFT JOIN information_schema.TABLES b ON a.TABLE_NAME = b.TABLE_NAME
LEFT JOIN information_schema.TABLES b ON a.TABLE_NAME = b.TABLE_NAME
WHERE a.TABLE_SCHEMA = #{dbName}
AND a.TABLE_NAME = #{tableName}
GROUP BY a.COLUMN_NAME
@ -130,7 +126,7 @@
FROM
code_model a
WHERE a.group_id = #{groupId}
ORDER BY a.create_time DESC
ORDER BY a.create_time DESC
</select>
<select id="queryTableBzByTableName" parameterType="java.util.Map" resultType="java.util.Map">
@ -148,11 +144,10 @@
b.TABLE_COMMENT AS tableComment
FROM
information_schema.COLUMNS a
LEFT JOIN information_schema.TABLES b ON a.TABLE_NAME = b.TABLE_NAME
WHERE
a.TABLE_SCHEMA = #{dbName}
AND a.TABLE_NAME = #{tableName}
GROUP BY a.TABLE_NAME
LEFT JOIN information_schema.TABLES b ON a.TABLE_NAME = b.TABLE_NAME
WHERE a.TABLE_SCHEMA = #{dbName}
AND a.TABLE_NAME = #{tableName}
GROUP BY a.TABLE_NAME
</select>
</mapper>

View file

@ -10,14 +10,12 @@
a.model_text modelText,
a.model_type modelType,
(SELECT COUNT(*) FROM code_model_history b WHERE b.model_id = a.id) useNum,
CONCAT_WS('_', d.job_number, d.user_name) createName,
a.create_id createId,
CONVERT(a.create_time, char) createTime,
CONCAT_WS('_', e.job_number, e.user_name) lastUpdateName,
a.last_update_id lastUpdateId,
CONVERT(a.last_update_time, char) lastUpdateTime
FROM
code_model a
LEFT JOIN sys_eve_user_staff d ON a.create_id = d.user_id
LEFT JOIN sys_eve_user_staff e ON a.last_update_id = e.user_id
WHERE a.group_id = #{groupId}
ORDER BY a.create_time DESC
</select>
@ -46,8 +44,7 @@
DELETE
FROM
code_model
WHERE
id = #{id}
WHERE id = #{id}
</delete>
<select id="queryCodeModelMationToEditById" parameterType="java.util.Map" resultType="java.util.Map">

View file

@ -21,6 +21,7 @@ import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
import com.skyeye.eve.dao.SysDictDataDao;
import com.skyeye.eve.entity.dict.SysDictDataMation;
import com.skyeye.eve.entity.dict.SysDictDataQueryDO;
import com.skyeye.eve.service.IAuthUserService;
import com.skyeye.eve.service.ISysDictDataService;
import com.skyeye.eve.service.SysDictDataService;
import com.skyeye.jedis.JedisClientService;
@ -60,6 +61,9 @@ public class SysDictDataServiceImpl implements SysDictDataService {
@Autowired
private ISysDictDataService iSysDictDataService;
@Autowired
private IAuthUserService iAuthUserService;
/**
* 获取数据字典列表
*
@ -71,6 +75,8 @@ public class SysDictDataServiceImpl implements SysDictDataService {
SysDictDataQueryDO sysDictDataQuery = inputObject.getParams(SysDictDataQueryDO.class);
Page pages = PageHelper.startPage(sysDictDataQuery.getPage(), sysDictDataQuery.getLimit());
List<SysDictDataMation> beans = sysDictDataDao.queryDictDataList(sysDictDataQuery);
iAuthUserService.setNameByIdForEntity(beans, "createId", "createName");
iAuthUserService.setNameByIdForEntity(beans, "lastUpdateId", "lastUpdateName");
outputObject.setBeans(beans);
outputObject.settotal(pages.getTotal());
}

View file

@ -12,15 +12,13 @@
s.is_default isDefault,
s.status,
s.remark,
CONCAT_WS('_', b.job_number, b.user_name) createName,
a.create_id createId,
CONVERT(s.create_time, char) createTime,
CONCAT_WS('_', c.job_number, c.user_name) lastUpdateName,
a.last_update_id lastUpdateId,
CONVERT(s.last_update_time, char) lastUpdateTime
FROM
sys_dict_data s
LEFT JOIN sys_dict_type a ON s.dict_type_id = a.id
LEFT JOIN sys_eve_user_staff b ON s.create_id = b.user_id
LEFT JOIN sys_eve_user_staff c ON s.last_update_id = c.user_id
<where>
<if test="dictName != '' and dictName != null">
AND s.dict_name LIKE '%${dictName}%'