Przeglądaj źródła

修改国标字典维护

guxinyu 2 lat temu
rodzic
commit
af8f65a27f

BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/dic/TDicBase.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/dic/TDicBaseVo.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/dic/TDicMappingVo.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/dic/TDicBaseController.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/dic/TDicMappingController.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/dic/TDicStandardController.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/dic/TDicBaseMapper.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/dic/TDicBaseService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/dic/TDicMappingService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/dic/TDicStandardService.java


+ 120 - 62
cbkj_web_parameter/src/main/resources/mappers/dic/TDicBaseMapper.xml

@@ -3,46 +3,53 @@
 <mapper namespace="com.jiuzhekan.cbkj.mapper.dic.TDicBaseMapper">
 
     <resultMap id="BaseResultMap" type="com.jiuzhekan.cbkj.beans.dic.TDicBase">
-        <id column="dic_id" jdbcType="VARCHAR"  property="dicId" />
-        <result column="dic_code" jdbcType="VARCHAR" property="dicCode" />
-        <result column="dic_name" jdbcType="VARCHAR" property="dicName" />
-        <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
-        <result column="dic_desc" jdbcType="VARCHAR" property="dicDesc" />
-        <result column="sort" jdbcType="VARCHAR" property="sort" />
-        <result column="app_id" jdbcType="VARCHAR" property="appId" />
-        <result column="ins_code" jdbcType="VARCHAR" property="insCode" />
-        <result column="dept_id" jdbcType="VARCHAR" property="deptId" />
-        <result column="pha_id" jdbcType="VARCHAR" property="phaId" />
-        <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
-        <result column="create_user" jdbcType="VARCHAR" property="createUser" />
-        <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
-        <result column="is_enable" jdbcType="VARCHAR" property="isEnable" />
+        <id column="dic_id" jdbcType="VARCHAR" property="dicId"/>
+        <result column="dic_code" jdbcType="VARCHAR" property="dicCode"/>
+        <result column="dic_name" jdbcType="VARCHAR" property="dicName"/>
+        <result column="stan_code" jdbcType="VARCHAR" property="stanCode"/>
+        <result column="stan_name" jdbcType="VARCHAR" property="stanName"/>
+        <result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
+        <result column="dic_desc" jdbcType="VARCHAR" property="dicDesc"/>
+        <result column="sort" jdbcType="VARCHAR" property="sort"/>
+        <result column="app_id" jdbcType="VARCHAR" property="appId"/>
+        <result column="ins_code" jdbcType="VARCHAR" property="insCode"/>
+        <result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
+        <result column="pha_id" jdbcType="VARCHAR" property="phaId"/>
+        <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
+        <result column="create_user" jdbcType="VARCHAR" property="createUser"/>
+        <result column="create_user_name" jdbcType="VARCHAR" property="createUserName"/>
+        <result column="is_enable" jdbcType="VARCHAR" property="isEnable"/>
+        <result column="mapping" jdbcType="VARCHAR" property="mapping"/>
+        <result column="id" jdbcType="VARCHAR" property="id"/>
     </resultMap>
 
 
     <sql id="Base_Column_List">
-    dic_id,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
+        dic_id
+        ,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
     </sql>
 
     <delete id="deleteByPrimaryKey" parameterType="TDicBase">
-        delete from t_dic_base where dic_id = #{ dicId }
+        delete
+        from t_dic_base
+        where dic_id = #{ dicId }
     </delete>
 
     <delete id="deleteBylist" parameterType="ArrayList">
         delete from t_dic_base where dic_id in
         <foreach collection="array" item="item" open="(" separator="," close=")">
-        #{item}
+            #{item}
         </foreach>
     </delete>
 
-    <insert id="insert"  parameterType="TDicBase">
-        insert into t_dic_base (<include refid="Base_Column_List" />) values
+    <insert id="insert" parameterType="TDicBase">
+        insert into t_dic_base (<include refid="Base_Column_List"/>) values
         (#{dicId},#{dicCode},#{dicName},#{parentId},#{dicDesc},#{sort},#{appId},#{insCode},#{deptId},#{phaId},#{createDate},#{createUser},#{createUserName},#{isEnable})
     </insert>
 
     <insert id="insertList" parameterType="List">
-        insert into t_dic_base (<include refid="Base_Column_List" />) values
-        <foreach collection="list" item="item" index="index" separator="," >
+        insert into t_dic_base (<include refid="Base_Column_List"/>) values
+        <foreach collection="list" item="item" index="index" separator=",">
             (#{item.dicId},#{item.dicCode},#{item.dicName},#{item.parentId},#{item.dicDesc},#{item.sort},#{item.appId},#{item.insCode},#{item.deptId},#{item.phaId},#{item.createDate},#{item.createUser},#{item.createUserName},#{item.isEnable})
         </foreach>
     </insert>
@@ -50,56 +57,58 @@
     <update id="updateByPrimaryKey" parameterType="TDicBase">
         update t_dic_base
         <set>
-             <if test="dicCode != null">
+            <if test="dicCode != null and dicCode!=''">
                 dic_code = #{ dicCode },
-             </if>
-             <if test="dicName != null">
+            </if>
+            <if test="dicName != null and dicName!=''">
                 dic_name = #{ dicName },
-             </if>
-             <if test="parentId != null">
+            </if>
+            <if test="parentId != null and parentId!=''">
                 parent_id = #{ parentId },
-             </if>
-             <if test="dicDesc != null">
+            </if>
+            <if test="dicDesc != null and dicDesc!=''">
                 dic_desc = #{ dicDesc },
-             </if>
-             <if test="sort != null">
+            </if>
+            <if test="sort != null and sort!=''">
                 sort = #{ sort },
-             </if>
-             <if test="appId != null">
+            </if>
+            <if test="appId != null and appId!=''">
                 app_id = #{ appId },
-             </if>
-             <if test="insCode != null">
+            </if>
+            <if test="insCode != null and insCode!=''">
                 ins_code = #{ insCode },
-             </if>
-             <if test="deptId != null">
+            </if>
+            <if test="deptId != null and deptId!=''">
                 dept_id = #{ deptId },
-             </if>
-             <if test="phaId != null">
+            </if>
+            <if test="phaId != null and phaId!=''">
                 pha_id = #{ phaId },
-             </if>
-             <if test="createDate != null">
+            </if>
+            <if test="createDate != null and createDate!=''">
                 create_date = #{ createDate },
-             </if>
-             <if test="createUser != null">
+            </if>
+            <if test="createUser != null and createUser!=''">
                 create_user = #{ createUser },
-             </if>
-             <if test="createUserName != null">
+            </if>
+            <if test="createUserName != null and createUserName!=''">
                 create_user_name = #{ createUserName },
-             </if>
-             <if test="isEnable != null">
+            </if>
+            <if test="isEnable != null and isEnable!=''">
                 is_enable = #{ isEnable },
-             </if>
+            </if>
         </set>
         where dic_id = #{ dicId }
     </update>
 
     <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
-        select <include refid="Base_Column_List" />
+        select
+        <include refid="Base_Column_List"/>
         from t_dic_base where dic_id = #{dicId}
     </select>
 
     <select id="getPageListByObj" parameterType="TDicBase" resultMap="BaseResultMap">
-        SELECT dic_id,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
+        SELECT
+        dic_id,dic_code,dic_name,parent_id,dic_desc,sort,app_id,ins_code,dept_id,pha_id,create_date,create_user,create_user_name,is_enable
         from t_dic_base
         <where>
             <if test=" dicName != null and dicName!='' ">
@@ -110,19 +119,68 @@
             </if>
         </where>
     </select>
-    <select id="getPageListByObjOrderByTips" parameterType="TDicBase" resultMap="BaseResultMap">
-        SELECT b.dic_id, dic_code,dic_name,
-               (SELECT a.dic_name FROM t_dic_base AS a WHERE b.parent_id=a.dic_id AND a.dic_name=#{dicName}) AS dic_pname,dic_desc,sort
-        from t_dic_base b
-        <where>
-            <if test=" dicName != null and dicName!='' ">
-                and dic_name like CONCAT('%',trim(#{dicName}),'%')
-            </if>
-            <if test=" dicCode != null and dicCode!='' ">
-                and dic_code like CONCAT('%',trim(#{dicCode}),'%')
-            </if>
-        </where>
+    <select id="getPageListNotInMapping" parameterType="TDicBase" resultMap="BaseResultMap">
+        SELECT
+        tdb.dic_code,tdb.dic_name,tdb.sort,tds.stan_code,tds.stan_name,tdm.id
+        FROM
+        t_dic_base AS tdb
+        INNER JOIN t_dic_base AS tb ON tb.dic_id=tdb.parent_id
+        LEFT JOIN t_dic_mapping AS tdm ON tdb.dic_id=tdm.dic_id
+        LEFT JOIN t_dic_standard AS tds ON tds.stan_id=tdm.stan_id
+        WHERE tdb.dic_id NOT IN(SELECT dic_id FROM t_dic_mapping)
+        AND
+        tdb.parent_id=#{dicId}
+        <if test=" dicName != null and dicName!='' ">
+            and tdb.dic_name like CONCAT('%',trim(#{dicName}),'%')
+        </if>
+        <if test=" dicCode != null and dicCode!='' ">
+            and tdb.dic_code like CONCAT('%',trim(#{dicCode}),'%')
+        </if>
+        <if test=" appId != null and appId!='' ">
+            and tdb.app_id =#{appId}
+        </if>
+        <if test=" insCode != null and insCode!='' ">
+            and tdb.ins_code =#{insCode}
+        </if>
+        <if test=" deptId != null and deptId!='' ">
+            and tdb.dept_id =#{deptId}
+        </if>
+        <if test=" phaId != null and phaId!='' ">
+            and tdb.pha_id =#{phaId}
+        </if>
+    </select>
+    <select id="getPageListInMapping" parameterType="TDicBase" resultMap="BaseResultMap">
+        SELECT
+        tdb.dic_code,tdb.dic_name,tdb.sort,tds.stan_code,tds.stan_name,tdm.id
+        FROM
+        t_dic_base AS tdb
+        INNER JOIN t_dic_base AS tb ON tb.dic_id=tdb.parent_id
+        LEFT JOIN t_dic_mapping AS tdm ON tdb.dic_id=tdm.dic_id
+        LEFT JOIN t_dic_standard AS tds ON tds.stan_id=tdm.stan_id
+        WHERE tdb.dic_id IN(SELECT dic_id FROM t_dic_mapping)
+        and
+        tdb.parent_id=#{dicId}
+        <if test=" dicCode != null and dicCode!='' ">
+            and dic_code like CONCAT('%',trim(#{dicCode}),'%')
+        </if>
+        <if test=" dicName != null and dicName!='' ">
+            and tdb.dic_name like CONCAT('%',trim(#{dicName}),'%')
+        </if>
+        <if test=" appId != null and appId!='' ">
+            and app_id =#{appId}
+        </if>
+        <if test=" insCode != null and insCode!='' ">
+            and ins_code =#{insCode}
+        </if>
+        <if test=" deptId != null and deptId!='' ">
+            and dept_id =#{deptId}
+        </if>
+        <if test=" phaId != null and phaId!='' ">
+            and pha_id =#{phaId}
+        </if>
+    </select>
+    <select id="getFname" resultMap="BaseResultMap">
+        SELECT dic_id, dic_name FROM t_dic_base WHERE parent_id='0' ORDER BY  sort ASC
     </select>
-
 
 </mapper>

+ 16 - 10
cbkj_web_parameter/src/main/resources/mappers/dic/TDicStandardMapper.xml

@@ -47,34 +47,34 @@
     <update id="updateByPrimaryKey" parameterType="TDicStandard">
         update t_dic_standard
         <set>
-             <if test="stanCode != null">
+             <if test="stanCode != null and stanCode!=''">
                 stan_code = #{ stanCode },
              </if>
-             <if test="stanName != null">
+             <if test="stanName != null and stanName!=''">
                 stan_name = #{ stanName },
              </if>
-             <if test="parentId != null">
+             <if test="parentId != null and parentId!=''">
                 parent_id = #{ parentId },
              </if>
-             <if test="stanDesc != null">
+             <if test="stanDesc != null and stanDesc!=''">
                 stan_desc = #{ stanDesc },
              </if>
-             <if test="stanType != null">
+             <if test="stanType != null and stanType!=''">
                 stan_type = #{ stanType },
              </if>
-             <if test="sort != null">
+             <if test="sort != null and sort!=''">
                 sort = #{ sort },
              </if>
-             <if test="createDate != null">
+             <if test="createDate != null and createDate!=''">
                 create_date = #{ createDate },
              </if>
-             <if test="createUser != null">
+             <if test="createUser != null and createUser!=''">
                 create_user = #{ createUser },
              </if>
-             <if test="createUserName != null">
+             <if test="createUserName != null and createUserName!=''">
                 create_user_name = #{ createUserName },
              </if>
-             <if test="isEnable != null">
+             <if test="isEnable != null and isEnable!=''">
                 is_enable = #{ isEnable },
              </if>
         </set>
@@ -93,6 +93,12 @@
             <if test=" stanName != null and stanName!='' ">
                 and stan_name like CONCAT('%',trim(#{stanName}),'%')
             </if>
+            <if test=" stanCode != null and stanCode!='' ">
+                and stan_code like CONCAT('%',trim(#{stanCode}),'%')
+            </if>
+            <if test=" stanType != null and stanType!='' ">
+                and stan_type=#{stanType}
+            </if>
         </where>
     </select>