|
@@ -7,13 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<resultMap type="ZwywJgFwjc" id="ZwywJgFwjcResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="jgId" column="jg_id" />
|
|
|
- <result property="zbXh" column="zb_xh" />
|
|
|
- <result property="jcMc" column="jc_mc" />
|
|
|
- <result property="isZdx" column="is_zdx" />
|
|
|
- <result property="jcXz" column="jc_xz" />
|
|
|
- <result property="jcFs" column="jc_fs" />
|
|
|
- <result property="jcJg" column="jc_jg" />
|
|
|
- <result property="jcXgcl" column="jc_xgcl" />
|
|
|
+ <result property="jcCs" column="jc_cs" />
|
|
|
+ <result property="tmsydx" column="tmsydx" />
|
|
|
+ <result property="zt" column="zt" />
|
|
|
<result property="createTimeStr" column="create_time_str" />
|
|
|
<result property="createUserId" column="create_user_id" />
|
|
|
<result property="createBy" column="create_by" />
|
|
@@ -26,11 +22,150 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateUnit" column="update_unit" />
|
|
|
<result property="updateUnitName" column="update_unit_name" />
|
|
|
<result property="state" column="state" />
|
|
|
+ <result property="jgmc" column="jgmc" />
|
|
|
+ <result property="tbr" column="tbr" />
|
|
|
+ <result property="tbrq" column="tbrq" />
|
|
|
+ <result property="zdxsfql" column="zdxsfql" />
|
|
|
+ <result property="fhs" column="fhs" />
|
|
|
</resultMap>
|
|
|
- <select id="selectMaxJcCs" resultType="string">
|
|
|
- SELECT MAX(jc_cs) FROM zwyw_jg_fwjc GROUP BY jc_cs
|
|
|
+
|
|
|
+ <resultMap id="ZwywJgFwjcZwywJgFwjcJcxxResult" type="ZwywJgFwjc" extends="ZwywJgFwjcResult">
|
|
|
+ <collection property="zwywJgFwjcJcxxList" notNullColumn="sub_id" javaType="java.util.List" resultMap="ZwywJgFwjcJcxxResult" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="ZwywJgFwjcJcxx" id="ZwywJgFwjcJcxxResult">
|
|
|
+ <result property="id" column="sub_id" />
|
|
|
+ <result property="fwjcId" column="sub_fwjc_id" />
|
|
|
+ <result property="zbXh" column="sub_zb_xh" />
|
|
|
+ <result property="jcMc" column="sub_jc_mc" />
|
|
|
+ <result property="isZdx" column="sub_is_zdx" />
|
|
|
+ <result property="jcXz" column="sub_jc_xz" />
|
|
|
+ <result property="jcFs" column="sub_jc_fs" />
|
|
|
+ <result property="jcJg" column="sub_jc_jg" />
|
|
|
+ <result property="jcXgcl" column="sub_jc_xgcl" />
|
|
|
+ <result property="label" column="sub_label" />
|
|
|
+ <result property="createTimeStr" column="sub_create_time_str" />
|
|
|
+ <result property="createUserId" column="sub_create_user_id" />
|
|
|
+ <result property="createBy" column="sub_create_by" />
|
|
|
+ <result property="createUserType" column="sub_create_user_type" />
|
|
|
+ <result property="createUnit" column="sub_create_unit" />
|
|
|
+ <result property="createUnitName" column="sub_create_unit_name" />
|
|
|
+ <result property="updateTimeStr" column="sub_update_time_str" />
|
|
|
+ <result property="updateUserId" column="sub_update_user_id" />
|
|
|
+ <result property="updateBy" column="sub_update_by" />
|
|
|
+ <result property="updateUnit" column="sub_update_unit" />
|
|
|
+ <result property="updateUnitName" column="sub_update_unit_name" />
|
|
|
+ <result property="state" column="sub_state" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+<!-- <select id="selectZwywJgFwJcById" parameterType="string" resultMap="ZwywJgFwjcZwywJgFwjcJcxxResult">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- a.id, a.jg_id, a.jc_cs, a.tmsydx, a.zt,-->
|
|
|
+<!-- a.create_time_str, a.create_user_id, a.create_by, a.create_unit, a.create_unit_name,-->
|
|
|
+<!-- a.update_time_str, a.update_user_id, a.update_by, a.update_unit, a.update_unit_name, a.state,-->
|
|
|
+<!-- b.id as sub_id, b.fwjc_id as sub_fwjc_id, b.zb_xh as sub_zb_xh, b.jc_mc as sub_jc_mc, b.is_zdx as sub_is_zdx,-->
|
|
|
+<!-- b.jc_xz as sub_jc_xz, b.jc_fs as sub_jc_fs, b.jc_jg as sub_jc_jg, b.jc_xgcl as sub_jc_xgcl,-->
|
|
|
+<!-- b.create_time_str as sub_create_time_str, b.create_user_id as sub_create_user_id,-->
|
|
|
+<!-- b.create_by as sub_create_by, b.create_unit as sub_create_unit, b.create_unit_name as sub_create_unit_name,-->
|
|
|
+<!-- b.update_time_str as sub_update_time_str, b.update_user_id as sub_update_user_id,-->
|
|
|
+<!-- b.update_by as sub_update_by, b.update_unit as sub_update_unit, b.update_unit_name as sub_update_unit_name,-->
|
|
|
+<!-- b.state as sub_state-->
|
|
|
+<!-- FROM zwyw_jg_fwjc a-->
|
|
|
+<!-- LEFT JOIN zwyw_jg_fwjc_jcxx b ON b.fwjc_id = a.id-->
|
|
|
+<!-- WHERE a.id = #{id}-->
|
|
|
+<!-- ORDER BY b.zb_xh ASC-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
+ <select id="selectZwywJgFwJcById" parameterType="string" resultMap="ZwywJgFwjcZwywJgFwjcJcxxResult">
|
|
|
+ SELECT
|
|
|
+ d.jgmc as jgmc, a.create_unit_name as tbr, SUBSTRING(a.create_time_str,1,8) as tbrq,
|
|
|
+ GROUP_CONCAT(c.dict_label) as sub_label,
|
|
|
+ a.id, a.jg_id, a.jc_cs, a.tmsydx, a.zt,
|
|
|
+ b.id as sub_id, b.fwjc_id as sub_fwjc_id, b.zb_xh as sub_zb_xh, b.jc_mc as sub_jc_mc, b.is_zdx as sub_is_zdx,
|
|
|
+ b.jc_xz as sub_jc_xz, b.jc_fs as sub_jc_fs, b.jc_jg as sub_jc_jg, b.jc_xgcl as sub_jc_xgcl,
|
|
|
+ b.state as sub_state
|
|
|
+ FROM zwyw_jg_fwjc a
|
|
|
+ LEFT JOIN zwyw_jg_fwjc_jcxx b ON b.fwjc_id = a.id
|
|
|
+ LEFT JOIN sys_dict_data c ON FIND_IN_SET(c.dict_value,b.jc_jg) AND c.dict_type = 'XZ032'
|
|
|
+ LEFT JOIN yljg_jcxx d ON d.id = a.jg_id
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ GROUP BY b.id
|
|
|
+ ORDER BY b.zb_xh ASC
|
|
|
</select>
|
|
|
|
|
|
+ <delete id="deleteZwywJgFwjcJcxxByFwjcId" parameterType="String">
|
|
|
+ delete from zwyw_jg_fwjc_jcxx where fwjc_id = #{fwjcId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZwywJgFwjcJcxxByFwjcIds" parameterType="String">
|
|
|
+ delete from zwyw_jg_fwjc_jcxx where fwjc_id in
|
|
|
+ <foreach item="fwjcId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{fwjcId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
|
|
|
+ <select id="selectZwywJgFwjcList" parameterType="ZwywJgFwjc" resultMap="ZwywJgFwjcResult">
|
|
|
+ SELECT
|
|
|
+ b.jgmc , getxzqhmcbycode(b.szxzqh) as szxzqh_name,
|
|
|
+ (
|
|
|
+ IF(
|
|
|
+ (SELECT COUNT(*) FROM zwyw_jg_fwjc_jcxx WHERE fwjc_id = a.id AND is_zdx = '2' AND daxx in(1,2) AND daxx is not null)
|
|
|
+ =
|
|
|
+ (SELECT COUNT(*) FROM zwyw_jg_fwjc_jcxx WHERE fwjc_id = a.id AND is_zdx = '2')
|
|
|
+ ,1,0)
|
|
|
+ ) as zdxsfql,
|
|
|
+ ( SELECT COUNT(*) FROM zwyw_jg_fwjc_jcxx
|
|
|
+ WHERE fwjc_id = a.id AND daxx = '1'
|
|
|
+ ) as fhs,
|
|
|
+ SUBSTRING(a.create_time_str,1,8) as tbrq,
|
|
|
+ a.id, a.jg_id, a.jc_cs, a.tmsydx, a.zt, a.state
|
|
|
+ FROM zwyw_jg_fwjc a
|
|
|
+ LEFT JOIN yljg_jcxx b ON b.id =a.jg_id
|
|
|
+ <where>
|
|
|
+ <if test="jgId != null "> and a.jg_id = #{jgId}</if>
|
|
|
+ <if test="zt != null "> and a.zt = #{zt}</if>
|
|
|
+ <if test="zdxsfql != null "> and
|
|
|
+ (
|
|
|
+ IF(
|
|
|
+ (SELECT COUNT(*) FROM zwyw_jg_fwjc_jcxx WHERE fwjc_id = a.id AND is_zdx = '2' AND daxx in(1,2) AND daxx is not null)
|
|
|
+ =
|
|
|
+ (SELECT COUNT(*) FROM zwyw_jg_fwjc_jcxx WHERE fwjc_id = a.id AND is_zdx = '2')
|
|
|
+ ,1,0)
|
|
|
+ ) = #{zdxsfql}
|
|
|
+ </if>
|
|
|
+ <if test="params.beginTbrq != null and params.beginTbrq != '' and params.endTbrq != null and params.endTbrq != ''"> and SUBSTRING(a.create_time_str,1,8) between #{params.beginTbrq} and #{params.endTbrq}</if>
|
|
|
+ <if test="params.beginTbrq != null and params.beginTbrq != '' and (params.endTbrq == null or params.endTbrq == '')"> and SUBSTRING(a.create_time_str,1,8) >= #{params.beginTbrq}</if>
|
|
|
+ <if test="(params.beginTbrq == null or params.beginTbrq == '') and params.endTbrq != null and params.endTbrq != ''"> and SUBSTRING(a.create_time_str,1,8) <= #{params.endTbrq}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZwywJgFwjcByJcCs" parameterType="ZwywJgFwjc" resultMap="ZwywJgFwjcZwywJgFwjcJcxxResult">
|
|
|
+ SELECT
|
|
|
+ a.id, a.jg_id, a.jc_cs, a.tmsydx, a.zt,
|
|
|
+ b.id as sub_id, b.fwjc_id as sub_fwjc_id, b.zb_xh as sub_zb_xh, b.jc_mc as sub_jc_mc, b.is_zdx as sub_is_zdx,
|
|
|
+ b.jc_xz as sub_jc_xz, b.jc_fs as sub_jc_fs, b.jc_jg as sub_jc_jg, b.jc_xgcl as sub_jc_xgcl,
|
|
|
+ b.state as sub_state
|
|
|
+ FROM zwyw_jg_fwjc a
|
|
|
+ LEFT JOIN zwyw_jg_fwjc_jcxx b ON b.fwjc_id = a.id
|
|
|
+ <where>
|
|
|
+ <if test="jgId != null and jgId != ''"> and a.jg_id = #{jgId}</if>
|
|
|
+ <if test="jcCs != null and jcCs != ''"> and a.jc_cs = #{jcCs}</if>
|
|
|
+ </where>
|
|
|
+ GROUP BY b.id
|
|
|
+ ORDER BY b.zb_xh ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="batchZwywJgFwjcJcxx">
|
|
|
+ insert into zwyw_jg_fwjc_jcxx( id, fwjc_id, zb_xh, jc_mc, is_zdx, jc_xz, jc_fs, jc_jg, jc_xgcl, create_time_str, create_user_id,create_user_type, create_by, create_unit, create_unit_name) values
|
|
|
+ <foreach item="item" index="index" collection="list" separator=",">
|
|
|
+ (REPLACE( UUID(),"-",""), #{item.fwjcId}, #{item.zbXh}, #{item.jcMc}, #{item.isZdx}, #{item.jcXz}, #{item.jcFs}, #{item.jcJg}, #{item.jcXgcl}, #{item.createTimeStr}, #{item.createUserId},#{item.createUserType}, #{item.createBy}, #{item.createUnit}, #{item.createUnitName})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="selectMaxJcCs" resultType="string">
|
|
|
+ SELECT MAX(jc_cs) FROM zwyw_jg_fwjc
|
|
|
+ WHERE
|
|
|
+ jg_id = #{jgId}
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|