1.修订业务辅助表-业务字典 业务辅助表=-系统字典管理平台
2.新增修改页面添加校验
①校验必填项
②校验itemCode是否重复
③校验父级与添加或修改配置的数据类型是否一致
④校验修改配置的数据类型类型与其下级数据类型是否一致
⑤无上级时、有下级时不得选为叶子节点
3.待解决项:
①点击操作弹出项样式
②校验程序偶有存在报出提示但无法阻止提交 情况
This commit is contained in:
@@ -13,25 +13,43 @@ import com.nis.web.dao.MyBatisDao;
|
||||
public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
|
||||
/**
|
||||
* 查询分类性质顶层字典列表(无条件查询)
|
||||
* 查询顶层字典列表(无条件查询(==))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有分类性质
|
||||
* 查询顶层字典列表(无条件查询(!=))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictListN(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有有效数据
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictList();
|
||||
List<ServiceDictInfo> findAllNoLeafDictList(@Param("itemType")Integer itemType);
|
||||
/**
|
||||
* 查询分类性质字典列表(含条件查询)
|
||||
* 根据上级id选出所有下级
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> getDictByParentId(Integer parentId);
|
||||
/**
|
||||
* 查询字典列表(含条件查询(==))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询字典列表(含条件查询(!=))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchListN(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
|
||||
/**
|
||||
@@ -46,34 +64,21 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
* @return
|
||||
*/
|
||||
ServiceDictInfo getDictById(Integer serviceDictId);
|
||||
|
||||
/**
|
||||
* 根据itemCode查询字典对象列表
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findByItemCode(Integer itemCode);
|
||||
|
||||
//标签管理
|
||||
/**
|
||||
* 查询标签顶层字典列表(无条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有标签
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询标签字典列表(条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictMarkList();
|
||||
|
||||
|
||||
|
||||
List<ServiceDictInfo> findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid);
|
||||
List<ServiceDictInfo> findAllItemDict(@Param("itemType")int itemType);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,22 +52,24 @@
|
||||
|
||||
|
||||
|
||||
<!-- 查询分类性质顶层分页列表 -->
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3 AND parent_id = 0
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -81,23 +83,24 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询标签顶层分页列表 -->
|
||||
<select id="findTopDictMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type = 3 AND parent_id = 0
|
||||
<!-- 查询顶层分页列表 (!=)-->
|
||||
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -110,48 +113,32 @@
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 查出所有分类性质 -->
|
||||
<!-- 查出所有 -->
|
||||
<select id="findAllDictList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type <![CDATA[<>]]> 3
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 查出所有标签-->
|
||||
<select id="findAllDictMarkList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type = 3
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type <![CDATA[<>]]> 3
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
<!-- 查询所有非叶子标签配置 -->
|
||||
<select id="findAllNoLeafDictMarkList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = 3
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 分类性质条件查询 -->
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
@@ -166,7 +153,8 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -180,27 +168,25 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 标签条件查询 -->
|
||||
<select id="findDictSearchMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type=3
|
||||
<!-- 条件查询分页(!=) -->
|
||||
<select id="findDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != ${itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -213,6 +199,7 @@
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
@@ -222,6 +209,22 @@
|
||||
from service_dict_info s where s.service_dict_id = #{serviceDictId}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from service_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
@@ -235,14 +238,7 @@
|
||||
#{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
<!--
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0;
|
||||
</select> -->
|
||||
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
|
||||
@@ -9,12 +9,29 @@ import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询生效范围字典列表,
|
||||
* 查询顶层字典列表(无条件查询(==))
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findDictList(SysDictInfo sysDictInfo);
|
||||
List<SysDictInfo> findTopDictList(SysDictInfo sysDictInfo);
|
||||
|
||||
/**
|
||||
* 查出所有有效数据
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllDictList(SysDictInfo sysDictInfo);
|
||||
|
||||
/**
|
||||
* 查询字典列表(含条件查询(==)
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findDictSearchList(SysDictInfo sysDictInfo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -30,11 +47,38 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
*/
|
||||
SysDictInfo getDictById(Integer sysDictId);
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllDict();
|
||||
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllNoLeafDictList(Integer itemType);
|
||||
|
||||
/**
|
||||
* 根据itemCode查询字典对象列表
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findByItemCode(Integer itemCode);
|
||||
|
||||
/**
|
||||
* 根据上级id选出所有下级
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> getDictByParentId(Integer parentId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -34,7 +34,6 @@
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="sysDictInfoColumns">
|
||||
s.sys_dict_id AS sysDictId,
|
||||
s.item_type AS itemType,
|
||||
@@ -49,10 +48,54 @@
|
||||
s.editor_id AS "sysDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
|
||||
<sql id="menuJoins">
|
||||
LEFT JOIN sys_dict_info p ON p.sys_dict_id = s.parent_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询分类性质列表 -->
|
||||
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查出所有 -->
|
||||
<select id="findAllDictList" resultType="sysDictInfo">
|
||||
SELECT
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
FROM sys_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
@@ -60,12 +103,15 @@
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -99,13 +145,14 @@
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="sysDictInfoColumns" />
|
||||
from sys_dict_info s where s.is_leaf = 0;
|
||||
</select>
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.SysDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
FROM sys_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
@@ -129,5 +176,21 @@
|
||||
UPDATE sys_dict_info s set s.is_valid = #{isValid} where s.sys_dict_id = #{sysDictId}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.SysDictInfo">
|
||||
select
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
from sys_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from sys_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user