Browse Source

1.数据字典bug修复。

tomatozq 5 years ago
parent
commit
c4ae0faee1

+ 1 - 1
picc-admin-server/src/main/java/com/jpsoft/picc/modules/sys/controller/DataDictionaryController.java

@@ -166,7 +166,7 @@ public class DataDictionaryController {
 
             for (String id : idList) {
                 DataDictionary dataDictionary = dataDictionaryService.get(id);
-                //dataDictionary.setDelFlag(true);
+                dataDictionary.setDelFlag(true);
                 dataDictionary.setUpdateBy(subject);
                 dataDictionary.setUpdateDate(new Date());
 

+ 122 - 122
picc-common/src/main/resources/mapper/sys/DataDictionary.xml

@@ -1,30 +1,30 @@
 <?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">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.picc.modules.sys.dao.DataDictionaryDAO">
-	<resultMap id="DataDictionaryMap" type="com.jpsoft.picc.modules.sys.entity.DataDictionary">
-		<id property="id" column="id_" />
-			<result property="name" column="name_" />
-			<result property="value" column="value_" />
-			<result property="sortNo" column="sort_no" />
-			<result property="parentId" column="parent_id" />
-			<result property="parentName" column="parent_name"/>
-			<result property="dataType" column="data_type" />
-			<result property="createBy" column="create_by" />
-			<result property="createDate" column="create_date" />
-			<result property="updateBy" column="update_by" />
-			<result property="updateDate" column="update_date" />
-			<result property="activated" column="activated_" />
-			<result property="delFlag" column="del_flag"/>
-			</resultMap>
-	<insert id="insert" parameterType="com.jpsoft.picc.modules.sys.entity.DataDictionary">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+    <resultMap id="DataDictionaryMap" type="com.jpsoft.picc.modules.sys.entity.DataDictionary">
+        <id property="id" column="id_"/>
+        <result property="name" column="name_"/>
+        <result property="value" column="value_"/>
+        <result property="sortNo" column="sort_no"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="dataType" column="data_type"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createDate" column="create_date"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateDate" column="update_date"/>
+        <result property="activated" column="activated_"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.picc.modules.sys.entity.DataDictionary">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
 		insert into sys_data_dictionary
 	    (id_,name_,value_,sort_no,parent_id,data_type,create_by,create_date,update_by,update_date,activated_,del_flag)
 		values
@@ -43,114 +43,114 @@
 ,#{delFlag,jdbcType= NUMERIC }
 		)
 	]]>
-	</insert>
-	<delete id="delete" parameterType="string">
-		delete from sys_data_dictionary where id_=#{id,jdbcType=VARCHAR}
-	</delete>
-	<update id="update" parameterType="com.jpsoft.picc.modules.sys.entity.DataDictionary">
-		update sys_data_dictionary
-		<set>
-				<if test="userName!=null">
-		name_=#{name,jdbcType=VARCHAR},
-		</if>
-				<if test="value!=null">
-		value_=#{value,jdbcType=VARCHAR},
-		</if>
-				<if test="sortNo!=null">
-		sort_no=#{sortNo,jdbcType= NUMERIC },
-		</if>
-				<if test="parentId!=null">
-		parent_id=#{parentId,jdbcType=VARCHAR},
-		</if>
-			<if test="dataType!=null">
-				data_type=#{dataType,jdbcType= NUMERIC },
-			</if>
-			<if test="createBy!=null">
-				create_by=#{createBy,jdbcType=VARCHAR},
-			</if>
-			<if test="createDate!=null">
-				create_date=#{createDate,jdbcType= TIMESTAMP },
-			</if>
-			<if test="updateBy!=null">
-				update_by=#{updateBy,jdbcType=VARCHAR},
-			</if>
-			<if test="updateDate!=null">
-				update_date=#{updateDate,jdbcType= TIMESTAMP },
-			</if>
-			<if test="activated!=null">
-				activated_=#{activated,jdbcType= NUMERIC },
-			</if>
-			<if test="delFlag!=null">
-				del_flag=#{delFlag,jdbcType= NUMERIC },
-			</if>
-		</set>
-	where id_=#{id}
-	</update>
-	<select id="get" parameterType="string" resultMap="DataDictionaryMap">
-		select a.*,b.name_ as parent_name
-		from sys_data_dictionary a left join sys_data_dictionary b on a.parent_id = b.id_
-		where a.id_=#{0} and a.del_flag = 0
-	</select>
-	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from sys_data_dictionary where id_=#{0} and del_flag = 0
-	</select>
-	<select id="list" resultMap="DataDictionaryMap">
-		select * from sys_data_dictionary where del_flag = 0
-	</select>
-	<select id="search" parameterType="hashmap" resultMap="DataDictionaryMap">
-		<![CDATA[
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_data_dictionary where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.picc.modules.sys.entity.DataDictionary">
+        update sys_data_dictionary
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="value!=null">
+                value_=#{value,jdbcType=VARCHAR},
+            </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
+            <if test="parentId!=null">
+                parent_id=#{parentId,jdbcType=VARCHAR},
+            </if>
+            <if test="dataType!=null">
+                data_type=#{dataType,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createDate!=null">
+                create_date=#{createDate,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateDate!=null">
+                update_date=#{updateDate,jdbcType= TIMESTAMP },
+            </if>
+            <if test="activated!=null">
+                activated_=#{activated,jdbcType= NUMERIC },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="DataDictionaryMap">
+        select a.*,b.name_ as parent_name
+        from sys_data_dictionary a left join sys_data_dictionary b on a.parent_id = b.id_
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_data_dictionary where id_=#{0} and del_flag = 0
+    </select>
+    <select id="list" resultMap="DataDictionaryMap">
+        select * from sys_data_dictionary where del_flag = 0
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="DataDictionaryMap">
+        <![CDATA[
 			SELECT
 				a.*,b.name_ AS parent_name
 			FROM
 				sys_data_dictionary a
 			LEFT JOIN sys_data_dictionary b ON a.parent_id = b.id_
 		]]>
-		<where>
-				a.del_flag = 0
-			<if test="searchParams.id != null">
-				and a.ID_ like #{searchParams.id}
-			</if>
-			<if test="searchParams.userName != null">
-				and a.name_ like #{searchParams.userName}
-			</if>
-			<if test="searchParams.excludeId != null">
-				<![CDATA[
+        <where>
+            a.del_flag = 0
+            <if test="searchParams.id != null">
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.excludeId != null">
+                <![CDATA[
 				and a.ID_ <> #{searchParams.excludeId}
 				]]>
-			</if>
-			<if test="searchParams.dataType != null">
-				and a.data_type = #{searchParams.dataType}
-			</if>
+            </if>
+            <if test="searchParams.dataType != null">
+                and a.data_type = #{searchParams.dataType}
+            </if>
 
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
 
-	<select id="queryChildren" resultType="java.util.HashMap" parameterType="string" >
-		SELECT
-		a.id_ as id,a.name_ as userName,a.value_ as value
-		FROM
-		sys_data_dictionary a where a.del_flag = 0
-		and data_type = 2
-		and a.parent_id = #{0}
-	</select>
+    <select id="queryChildren" resultType="java.util.HashMap" parameterType="string">
+        SELECT
+        a.id_ as id,a.name_ as name,a.value_ as value
+        FROM
+        sys_data_dictionary a where a.del_flag = 0
+        and data_type = 2
+        and a.parent_id = #{0}
+    </select>
 
-	<select id="getName" parameterType="string" resultType="string">
-		select a.name_ as userName
-		from sys_data_dictionary a
-		where a.id_=#{0} and a.del_flag = 0
-	</select>
-	<select id="getValue" parameterType="string" resultType="string">
-		select a.value_ as value
-		from sys_data_dictionary a
-		where a.id_=#{0} and a.del_flag = 0
-	</select>
+    <select id="getName" parameterType="string" resultType="string">
+        select a.name_ as name
+        from sys_data_dictionary a
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
+    <select id="getValue" parameterType="string" resultType="string">
+        select a.value_ as value
+        from sys_data_dictionary a
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
 
-	<select id="findParentId" parameterType="string" resultType="string">
-		select a.name_ as userName
-		from sys_data_dictionary a
-		where a.parent_id =#{parentId} and a.value_=#{0} and a.del_flag = 0
-	</select>
+    <select id="findParentId" parameterType="string" resultType="string">
+        select a.name_ as name
+        from sys_data_dictionary a
+        where a.parent_id =#{parentId} and a.value_=#{0} and a.del_flag = 0
+    </select>
 </mapper>