|
@@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateUnit" column="update_unit" />
|
|
|
<result property="updateUnitName" column="update_unit_name" />
|
|
|
+ <result property="txdz" column="txdz" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
@@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT
|
|
|
IFNULL(b.jgmc,c.jgmc) as jgmc,
|
|
|
IFNULL(b.tyshxydm, c.tyshxydm) as tyshxydm,
|
|
|
- IF(LENGTH(getxzqhmcbycode(b.szxzqh))>0,getxzqhmcbycode(b.szxzqh),getxzqhmcbycode(c.szxzqh)) as szxzqh_name,
|
|
|
+ IF(LENGTH(getxzqhmcbycode(b.szxzqh))>0,CONCAT(getxzqhmcbycode(b.szxzqh),b.txdz),CONCAT(getxzqhmcbycode(c.szxzqh),c.txdz)) as szxzqh_name,
|
|
|
a.*
|
|
|
FROM yljg_lryp a
|
|
|
LEFT JOIN yljg_jcxx b ON a.jg_id = b.id
|
|
@@ -44,17 +45,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectYljgLrypList" parameterType="YljgLryp" resultMap="YljgLrypResult">
|
|
|
- <include refid="selectYljgLrypVo"/>
|
|
|
+ SELECT
|
|
|
+ b.jgmc,b.tyshxydm,
|
|
|
+ getxzqhmcbycode(b.szxzqh) as szxzqh_name,
|
|
|
+ a.*
|
|
|
+ FROM yljg_lryp a
|
|
|
+ LEFT JOIN yljg_jcxx b ON a.jg_id = b.id
|
|
|
+ <where>
|
|
|
+ b.sczt = '01'
|
|
|
+ AND a.state = '1'
|
|
|
+ <if test="tyshxydm != null and tyshxydm != ''"> and b.tyshxydm like concat('%', #{tyshxydm}, '%')</if>
|
|
|
+ <if test="jgmc != null and jgmc != ''"> and b.jgmc like concat('%', #{jgmc}, '%')</if>
|
|
|
+ <if test="lrypmc != null and lrypmc != ''"> and a.lrypmc like concat('%', #{lrypmc}, '%')</if>
|
|
|
+ <if test="jgId != null and jgId != ''"> and a.jg_id = #{jgId}</if>
|
|
|
+ <if test="lryplx != null and lryplx != ''"> and a.lryplx = #{lryplx}</if>
|
|
|
+ <if test="ypsccs != null and ypsccs != ''"> and a.ypsccs like concat('%',#{ypsccs},'%')</if>
|
|
|
+ <if test="xzqhId != null and isBj == null"> and b.ssxzqh IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
+ <if test="xzqhId != null and isBj == 0"> and b.ssxzqh IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
+ <if test="xzqhId != null and isBj == 1"> and b.ssxzqh = #{xzqhId}</if>
|
|
|
+ <if test="createUserType != null and createUserType != ''"> and a.create_user_type = #{createUserType}</if>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.create_time_str DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSqYljgLrypList" parameterType="YljgLryp" resultMap="YljgLrypResult">
|
|
|
+ SELECT
|
|
|
+ b.jgmc,b.tyshxydm,
|
|
|
+ getxzqhmcbycode(b.szxzqh) as szxzqh_name,
|
|
|
+ a.*
|
|
|
+ FROM yljg_lryp a
|
|
|
+ LEFT JOIN yljgsq_jcxx b ON a.jg_id = b.id
|
|
|
<where>
|
|
|
- <if test="tyshxydm != null and tyshxydm != ''"> and IFNULL(b.tyshxydm, c.tyshxydm) like concat('%', #{tyshxydm}, '%')</if>
|
|
|
- <if test="jgmc != null and jgmc != ''"> and IFNULL(b.jgmc, c.jgmc) like concat('%', #{jgmc}, '%')</if>
|
|
|
+ b.sczt = '01'
|
|
|
+ AND a.state = '1'
|
|
|
+ <if test="tyshxydm != null and tyshxydm != ''"> and b.tyshxydm like concat('%', #{tyshxydm}, '%')</if>
|
|
|
+ <if test="jgmc != null and jgmc != ''"> and b.jgmc like concat('%', #{jgmc}, '%')</if>
|
|
|
<if test="lrypmc != null and lrypmc != ''"> and a.lrypmc like concat('%', #{lrypmc}, '%')</if>
|
|
|
<if test="jgId != null and jgId != ''"> and a.jg_id = #{jgId}</if>
|
|
|
<if test="lryplx != null and lryplx != ''"> and a.lryplx = #{lryplx}</if>
|
|
|
<if test="ypsccs != null and ypsccs != ''"> and a.ypsccs like concat('%',#{ypsccs},'%')</if>
|
|
|
- <if test="xzqhId != null and isBj == null"> and IFNULL(b.ssxzqh,c.ssxzqh) IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
- <if test="xzqhId != null and isBj == 0"> and IFNULL(b.ssxzqh,c.ssxzqh) IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
- <if test="xzqhId != null and isBj == 1"> and IFNULL(b.ssxzqh,c.ssxzqh) = #{xzqhId}</if>
|
|
|
+ <if test="xzqhId != null and isBj == null"> and b.ssxzqh IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
+ <if test="xzqhId != null and isBj == 0"> and b.ssxzqh IN ( SELECT CODE FROM SYS_DEPT_JL WHERE FIND_IN_SET(#{xzqhId},ancestors) OR CODE = #{xzqhId} )</if>
|
|
|
+ <if test="xzqhId != null and isBj == 1"> and b.ssxzqh = #{xzqhId}</if>
|
|
|
<if test="createUserType != null and createUserType != ''"> and a.create_user_type = #{createUserType}</if>
|
|
|
</where>
|
|
|
ORDER BY a.create_time_str DESC
|
|
@@ -65,6 +97,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectYljgLrypByJgId" parameterType="String" resultMap="YljgLrypResult">
|
|
|
+ SELECT
|
|
|
+ IFNULL(b.jgmc,c.jgmc) as jgmc,
|
|
|
+ IFNULL(b.tyshxydm, c.tyshxydm) as tyshxydm,
|
|
|
+ getxzqhmcbycode(b.szxzqh) as szxzqh_name,
|
|
|
+ b.txdz,
|
|
|
+ a.*
|
|
|
+ FROM yljg_lryp a
|
|
|
+ LEFT JOIN yljg_jcxx b ON a.jg_id = b.id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectYljgLrypBySqJgId" parameterType="String" resultMap="YljgLrypResult">
|
|
|
+ SELECT
|
|
|
+ b.jgmc,b.tyshxydm,
|
|
|
+ getxzqhmcbycode(b.szxzqh) as szxzqh_name,
|
|
|
+ b.txdz,
|
|
|
+ a.*
|
|
|
+ FROM yljg_lryp a
|
|
|
+ LEFT JOIN yljgsq_jcxx b ON a.jg_id = b.id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insertYljgLryp" parameterType="YljgLryp">
|
|
|
insert into yljg_lryp
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|