|
@@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select a.id, a.jg_id, a.xm, a.xb, a.zjhm, a.csrq, a.nlpg, a.is_cj, b.jgmc as jgmc,
|
|
|
b.szxzqh as xjdxzqy
|
|
|
from yljg_kh_jbxx a
|
|
|
- left join yljg_jcxx b on a.jg_id = b.id
|
|
|
+ left join yljg_jcxx b on a.jg_id = b.id and b.state = '0'
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectYljgKhJbxxList" parameterType="YljgKhJbxx" resultMap="YljgKhJbxxResult">
|
|
@@ -140,12 +140,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<where>
|
|
|
a.state = '0'
|
|
|
and a.is_rz = '1'
|
|
|
+ and a.create_user_type = '01'
|
|
|
<if test="xm != null and xm != ''"> and a.xm like concat('%', #{xm}, '%')</if>
|
|
|
<if test="zjhm != null and zjhm != ''"> and a.zjhm like concat('%', #{zjhm}, '%')</if>
|
|
|
<if test="jgmc != null and jgmc != ''"> and b.jgmc like concat('%', #{jgmc}, '%')</if>
|
|
|
<if test="nlpg != null and nlpg != ''"> and a.nlpg = #{nlpg}</if>
|
|
|
<if test="isCj != null and isCj != ''"> and a.is_cj = #{isCj}</if>
|
|
|
- <if test="xzqhId != null and xzqhId != ''"> and b.szxzqh = #{xzqhId}</if>
|
|
|
+ <if test="xzqhId != null and xzqhId != ''"> and (b.szxzqh IN ( SELECT dept_id FROM sys_dept WHERE dept_id = #{xzqhId} or find_in_set( #{xzqhId} , ancestors ) ))</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="selectYljgKhJbxxSqVo">
|
|
|
+ select a.id, a.jg_id, a.xm, a.xb, a.zjhm, a.csrq, a.nlpg, a.is_cj, b.jgmc as jgmc,
|
|
|
+ b.szxzqh as xjdxzqy
|
|
|
+ from yljg_kh_jbxx a
|
|
|
+ left join yljgsq_jcxx b on a.jg_id = b.id and b.state = '0'
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxSqList" parameterType="YljgKhJbxx" resultMap="YljgKhJbxxResult">
|
|
|
+ <include refid="selectYljgKhJbxxSqVo"/>
|
|
|
+ <where>
|
|
|
+ a.state = '0'
|
|
|
+ and a.create_user_type = '02'
|
|
|
+ <if test="xm != null and xm != ''"> and a.xm like concat('%', #{xm}, '%')</if>
|
|
|
+ <if test="zjhm != null and zjhm != ''"> and a.zjhm like concat('%', #{zjhm}, '%')</if>
|
|
|
+ <if test="jgmc != null and jgmc != ''"> and b.jgmc like concat('%', #{jgmc}, '%')</if>
|
|
|
+ <if test="nlpg != null and nlpg != ''"> and a.nlpg = #{nlpg}</if>
|
|
|
+ <if test="isCj != null and isCj != ''"> and a.is_cj = #{isCj}</if>
|
|
|
+ <if test="xzqhId != null and xzqhId != ''"> and (b.szxzqh IN ( SELECT dept_id FROM sys_dept WHERE dept_id = #{xzqhId} or find_in_set( #{xzqhId} , ancestors ) ))</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|