|
@@ -131,8 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<sql id="selectYljgKhJbxxVo">
|
|
|
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 and b.state = '0'
|
|
|
+ from yljg_kh_jbxx a FORCE INDEX (idx_rzjg)
|
|
|
+ left join yljg_jcxx b on a.jg_id = b.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectYljgKhJbxxList" parameterType="YljgKhJbxx" resultMap="YljgKhJbxxResult">
|
|
@@ -153,8 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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'
|
|
|
+ from yljg_kh_jbxx a FORCE INDEX (idx_sqfw)
|
|
|
+ left join yljgsq_jcxx b on a.jg_id = b.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectYljgKhJbxxSqList" parameterType="YljgKhJbxx" resultMap="YljgKhJbxxResult">
|
|
@@ -250,4 +250,175 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
id = #{id}
|
|
|
AND state = '0'
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxCount" parameterType="YljgKhJbxx" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(0)
|
|
|
+ FROM
|
|
|
+ yljg_kh_jbxx FORCE INDEX (idx_rzjg)
|
|
|
+ <where>
|
|
|
+ state = '0'
|
|
|
+ AND is_rz = '1'
|
|
|
+ AND create_user_type = '01'
|
|
|
+ <if test="xm != null and xm != ''"> and xm like concat('%', #{xm}, '%')</if>
|
|
|
+ <if test="zjhm != null and zjhm != ''"> and zjhm = #{zjhm}</if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId != null and xzqhId != '')">
|
|
|
+ AND jg_id IN (select id from yljg_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ) and jgmc like concat('%', #{jgmc}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId == null or xzqhId == '')"> AND jg_id IN (select id from yljg_jcxx where jgmc like concat('%', #{jgmc}, '%'))</if>
|
|
|
+ <if test="(jgmc == null or jgmc == '') and (xzqhId != null and xzqhId != '')"> AND jg_id IN (select id from yljg_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ))</if>
|
|
|
+ <if test="nlpg != null and nlpg != ''"> and nlpg = #{nlpg}</if>
|
|
|
+ <if test="isCj != null and isCj != ''"> and is_cj = #{isCj}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxSqCount" parameterType="YljgKhJbxx" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(0)
|
|
|
+ FROM
|
|
|
+ yljg_kh_jbxx FORCE INDEX (idx_sqfw)
|
|
|
+ <where>
|
|
|
+ state = '0'
|
|
|
+ AND create_user_type = '02'
|
|
|
+ <if test="xm != null and xm != ''"> and xm like concat('%', #{xm}, '%')</if>
|
|
|
+ <if test="zjhm != null and zjhm != ''"> and zjhm = #{zjhm}</if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId != null and xzqhId != '')">
|
|
|
+ AND jg_id IN (select id from yljgsq_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ) and jgmc like concat('%', #{jgmc}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId == null or xzqhId == '')"> AND jg_id IN (select id from yljgsq_jcxx where jgmc like concat('%', #{jgmc}, '%'))</if>
|
|
|
+ <if test="(jgmc == null or jgmc == '') and (xzqhId != null and xzqhId != '')"> AND jg_id IN (select id from yljgsq_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ))</if>
|
|
|
+ <if test="nlpg != null and nlpg != ''"> and nlpg = #{nlpg}</if>
|
|
|
+ <if test="isCj != null and isCj != ''"> and is_cj = #{isCj}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxPageIdList" parameterType="YljgKhJbxx" resultType="String">
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ yljg_kh_jbxx FORCE INDEX (idx_rzjg)
|
|
|
+ <where>
|
|
|
+ state = '0'
|
|
|
+ AND is_rz = '1'
|
|
|
+ AND create_user_type = '01'
|
|
|
+ <if test="xm != null and xm != ''"> and xm like concat('%', #{xm}, '%')</if>
|
|
|
+ <if test="zjhm != null and zjhm != ''"> and zjhm = #{zjhm}</if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId != null and xzqhId != '')">
|
|
|
+ AND jg_id IN (select id from yljg_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ) and jgmc like concat('%', #{jgmc}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId == null or xzqhId == '')"> AND jg_id IN (select id from yljg_jcxx where jgmc like concat('%', #{jgmc}, '%'))</if>
|
|
|
+ <if test="(jgmc == null or jgmc == '') and (xzqhId != null and xzqhId != '')"> AND jg_id IN (select id from yljg_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ))</if>
|
|
|
+ <if test="nlpg != null and nlpg != ''"> and nlpg = #{nlpg}</if>
|
|
|
+ <if test="isCj != null and isCj != ''"> and is_cj = #{isCj}</if>
|
|
|
+ </where>
|
|
|
+ LIMIT #{params.pageNum}, #{params.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxSqPageIdList" parameterType="YljgKhJbxx" resultType="String">
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ yljg_kh_jbxx FORCE INDEX (idx_sqfw)
|
|
|
+ <where>
|
|
|
+ state = '0'
|
|
|
+ AND create_user_type = '02'
|
|
|
+ <if test="xm != null and xm != ''"> and xm like concat('%', #{xm}, '%')</if>
|
|
|
+ <if test="zjhm != null and zjhm != ''"> and zjhm = #{zjhm}</if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId != null and xzqhId != '')">
|
|
|
+ AND jg_id IN (select id from yljgsq_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ) and jgmc like concat('%', #{jgmc}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="(jgmc != null and jgmc != '') and (xzqhId == null or xzqhId == '')"> AND jg_id IN (select id from yljgsq_jcxx where jgmc like concat('%', #{jgmc}, '%'))</if>
|
|
|
+ <if test="(jgmc == null or jgmc == '') and (xzqhId != null and xzqhId != '')"> AND jg_id IN (select id from yljgsq_jcxx where szxzqh IN (
|
|
|
+ SELECT
|
|
|
+ dept_id
|
|
|
+ FROM
|
|
|
+ sys_dept
|
|
|
+ WHERE
|
|
|
+ dept_id = #{xzqhId}
|
|
|
+ OR find_in_set(#{xzqhId}, ancestors)
|
|
|
+ ))</if>
|
|
|
+ <if test="nlpg != null and nlpg != ''"> and nlpg = #{nlpg}</if>
|
|
|
+ <if test="isCj != null and isCj != ''"> and is_cj = #{isCj}</if>
|
|
|
+ </where>
|
|
|
+ LIMIT #{params.pageNum}, #{params.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxPage" parameterType="java.util.List" resultMap="YljgKhJbxxResult">
|
|
|
+ select id, jg_id, xm, xb, zjhm, csrq, nlpg, is_cj, (select CONCAT_WS('%%', jgmc, szxzqh) from yljg_jcxx where yljg_jcxx.id = yljg_kh_jbxx.jg_id) AS jgmc
|
|
|
+ from yljg_kh_jbxx
|
|
|
+ <where>
|
|
|
+ id in
|
|
|
+ <foreach item="id" collection="list" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectYljgKhJbxxSqPage" parameterType="java.util.List" resultMap="YljgKhJbxxResult">
|
|
|
+ select id, jg_id, xm, xb, zjhm, csrq, nlpg, is_cj, (select CONCAT_WS('%%', jgmc, szxzqh) from yljgsq_jcxx where yljgsq_jcxx.id = yljg_kh_jbxx.jg_id) AS jgmc
|
|
|
+ from yljg_kh_jbxx
|
|
|
+ <where>
|
|
|
+ id in
|
|
|
+ <foreach item="id" collection="list" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|