1.修订业务辅助表-业务字典 业务辅助表=-系统字典管理平台

2.新增修改页面添加校验
     ①校验必填项
     ②校验itemCode是否重复
     ③校验父级与添加或修改配置的数据类型是否一致
     ④校验修改配置的数据类型类型与其下级数据类型是否一致
     ⑤无上级时、有下级时不得选为叶子节点
 3.待解决项:
    ①点击操作弹出项样式
    ②校验程序偶有存在报出提示但无法阻止提交 情况
This commit is contained in:
zhangshilin
2018-03-04 19:20:32 +08:00
parent 5517d78ce1
commit bb27ba16db
25 changed files with 1925 additions and 1121 deletions

View File

@@ -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 &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= 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 &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
AND create_time &lt;= 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>