<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mosty.sjzx.mapper.SgfxMapper">
    <select id="jmjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq>=#{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or ay like '0203%'
        or ay='02040100' or ay like '0205%')
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="wffzjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="zjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq>=#{dto.ksrq} and jqfsksrq &lt;=#{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="yjmjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny>=#{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or
        ay like '0203%' or ay='02040100' or ay like '0205%')
        ${useSql}
    </select>

    <select id="yzwffzjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="yzjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny>=#{dto.ksny} and jqfsksny &lt;=#{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="zjmjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq>=#{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or ay like '0203%' or
        ay='02040100' or ay like '0205%')
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="zwffzjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="zzjq" resultType="java.util.Map">
        select ay,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by ay order by sl desc
    </select>

    <select id="gfsdfxJmjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100'
        or ay like '0203%' or ay='02040100' or ay like '0205%')
        ${useSql}
    </select>

    <select id="gfsdfxWffzjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxZjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxYjmjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or
        ay like '0203%' or ay='02040100' or ay like '0205%')
        ${useSql}
    </select>

    <select id="ywffzjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxYzjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxZjmjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or ay
        like '0203%' or ay='02040100' or ay like '0205%')
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxZwffzjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        and (ay like '01%' or ay like '02%')
        ${useSql}
        group by jqfsksxs order by jqfsksxs
    </select>

    <select id="gfsdfxZzjq" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by jqfsksxs order by jqfsksxs asc
    </select>

    <select id="aylx" resultType="java.util.Map">
        select * from tb_case_type
        <if test="code != null and code != ''">
            where code like concat('%',#{code},'%')
        </if>
    </select>

    <select id="zzjg" resultType="java.util.Map">
        select id, org_code, org_name, root_path, org_type, org_type_name, org_short_name
        from mosty_base.sys_dept
        order by org_code
    </select>

    <select id="zdgzJqtj" resultType="java.util.Map">
        select
        COALESCE(sum(xt_sjzt='1'),0) as zjq,
        COALESCE(sum(xt_sjzt='1' and sfzdjq='1'), 0) as zdjq,
        COALESCE(sum(xt_sjzt='1' and ay like '01%' or ay like '02%'),0) as wffz,
        COALESCE(sum(xt_sjzt='1' and ay like '0111%' or ay like '0112%' or ay like '0114%' or ay='01130100' or
        ay like '0203%' or ay='02040100' or ay like '0205%'), 0) as jmjq
        from mosty_sjzx.tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
    </select>

    <select id="rtj" resultType="java.util.Map">
        select jqfsksrq,bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
    </select>

    <select id="ytj" resultType="java.util.Map">
        select jqfsksny,bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        group by jqfsksny,bjlb order by jqfsksny
    </select>

    <select id="ztj" resultType="java.util.Map">
        select jqfskszs, bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by jqfskszs, bjlb order by jqfskszs
    </select>

    <select id="scryyj" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by jqfsksxs order by jqfsksxs asc
    </select>

    <select id="yscryyj" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by jqfsksxs order by jqfsksxs asc
    </select>

    <select id="zscryyj" resultType="java.util.Map">
        select jqfsksxs,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by jqfsksxs order by jqfsksxs asc
    </select>

    <select id="pcsfafxRtj" resultType="java.util.Map">
        select ssbmdm,jqfsksrq,bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by ssbmdm,jqfsksrq,bjlb
    </select>

    <select id="pcsfafxytj" resultType="java.util.Map">
        select ssbmdm,jqfsksny,bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by ssbmdm,jqfsksny,bjlb
    </select>

    <select id="pcsfafxztj" resultType="java.util.Map">
        select ssbmdm,jqfskszs,bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by ssbmdm,jqfskszs,bjlb
    </select>

    <select id="ztsjtj" resultType="java.util.Map">
        select bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksrq >= #{dto.ksrq} and jqfsksrq &lt;= #{dto.jsrq}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
        group by bjlb order by sl desc
    </select>

    <select id="yztsjtj" resultType="java.util.Map">
        select bjlb,count(1) as sl from tb_jq
        where xt_sjzt='1' and jqfsksny >= #{dto.ksny} and jqfsksny &lt;= #{dto.jsny}
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.ssxgajdm != null and dto.ssxgajdm != ''">
            and ssxgajdm = #{dto.ssxgajdm}
        </if>
        ${useSql}
        and (ay='01120400' or ay='01120800' or ay='0203200' or ay='02030300')
    </select>

    <select id="jrjqczfx" resultType="java.util.Map">
        select czzt, count(1) as sl from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0' and czzt is not null
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by czzt order by sl desc
    </select>

    <select id="jrjqslzs" resultType="java.util.Map">
        select jqfsksxs, count(1) as sl from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0' and jqfsksxs is not null
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by jqfsksxs order by jqfsksxs asc
    </select>

    <select id="jrjqyj" resultType="java.util.Map">
        select count(1) as sl from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
    </select>

    <select id="jqlxtj" resultType="java.util.Map">
        select bjlxmc, count(1) as sl from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0' and bjlxmc is not null
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by bjlxmc order by sl desc
    </select>

    <select id="jqlbCount" resultType="int">
        select count(1) from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.bjrXm != nul and dto.bjrXm != ''">
            and bjr_xm like concat('%',#{dto.bjrXm},'%')
        </if>
        <if test="dto.bjnr != nul and dto.bjnr != ''">
            and bjnr like concat('%',#{dto.bjnr},'%')
        </if>
        ${useSql}
    </select>

    <select id="jqlb" resultType="java.util.Map">
        select * from mosty_sjzx.tb_jq where
        xt_sjzt = '1' and xt_scbz = '0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and jqfsksrq >= #{dto.kssj}
        </if>
        <if test="dto.jssj != nul and dto.jssj != ''">
            and jqfsksrq &lt;= #{dto.jssj}
        </if>
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        <if test="dto.bjrXm != nul and dto.bjrXm != ''">
            and bjr_xm like concat('%',#{dto.bjrXm},'%')
        </if>
        <if test="dto.bjnr != nul and dto.bjnr != ''">
            and bjnr like concat('%',#{dto.bjnr},'%')
        </if>
        ${useSql}
        order by jqfskssj desc
        limit #{pageIndex},#{pageSize}
    </select>


    <select id="sblxtj" resultType="java.util.Map">
        select sblx, count(1) as sl from mosty_yszx.tb_ys_sxt where
        xt_sjzt = '1' and xt_scbz = '0' and sblx is not null
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by sblx order by sl desc
    </select>

    <select id="sblbCount" resultType="int">
        select count(1) from mosty_yszx.tb_ys_sxt where
        xt_sjzt = '1' and xt_scbz = '0'
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
    </select>

    <select id="sblb" resultType="java.util.Map">
        select count(1) from mosty_yszx.tb_ys_sxt where
        xt_sjzt = '1' and xt_scbz = '0'
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        limit #{pageIndex},#{pageSize}
        order by xt_cjsj desc
    </select>

    <select id="jwzbmlbtj" resultType="java.util.Map">
        select ssbmdm, ssbm,
        COALESCE(SUM(jwz_lx = '1'),0) as jmjwz,
        COALESCE(SUM(jwz_lx = '2'),0) as ydjwc,
        COALESCE(SUM(jwz_lx = '3'),0) as zhzagt
        from mosty_jcgl.tb_jcgl_jwz where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.jwzlx != null and dto.jwzlx != ''">
            and jwz_lx = #{dto.jwzlx}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by ssbmdm, ssbm
    </select>

    <select id="bmtjjwz" resultType="java.util.Map">
        select ssbmdm, ssbm,
        COALESCE(SUM(jwz_lx = '1'),0) as jmjwz,
        COALESCE(SUM(jwz_lx = '2'),0) as ydjwc,
        COALESCE(SUM(jwz_lx = '3'),0) as zhzagt
        from mosty_jcgl.tb_jcgl_jwz where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.jwzlx != null and dto.jwzlx != ''">
            and jwz_lx = #{dto.jwzlx}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by ssbmdm, ssbm order by ssbmdm asc
    </select>

    <select id="clbmtj" resultType="java.util.Map">
        select ssbmdm, ssbm, count(1) as sl from mosty_qwgl.tb_qw_cl where xt_sjzt='1' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        group by ssbmdm,ssbm order by sl desc
    </select>

    <select id="fjbmtj" resultType="java.util.Map">
        select ssbmdm, ssbm, count(1) as sl from mosty_qwgl.tb_qw_jl where xt_sjzt='1' and jllx='02' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        group by ssbmdm,ssbm order by sl desc
    </select>

    <select id="mjbmtj" resultType="java.util.Map">
        select ssbmdm, ssbm, count(1) as sl from mosty_qwgl.tb_qw_jl where xt_sjzt='1' and jllx='01' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        group by ssbmdm, ssbm order by sl desc
    </select>

    <select id="zttjz" resultType="java.util.Map">
        select a.sl as mjsl,b.sl as fjsl,c.sl as clsl from
        (
        select count(1) as sl from mosty_qwgl.tb_qw_jl where xt_sjzt='1' and jllx='01' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        ) a,
        (
        select count(1) as sl from mosty_qwgl.tb_qw_jl where xt_sjzt='1' and jllx='02' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        ) b,
        (
        select count(1) as sl from mosty_qwgl.tb_qw_cl where xt_sjzt='1' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        ${useSql}
        ) c
    </select>

    <select id="lbtj" resultType="java.util.Map">
        select ssbmdm, ssbm, COALESCE(SUM(txzblx = '01'),0) as jwzd,COALESCE(SUM(txzblx = '02'),0) as
        zfjly,COALESCE(SUM(txzblx = '03'),0) as djj from mosty_qwgl.tb_qw_znzb where xt_sjzt='1' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        <if test="dto.txzblx != null and dto.txzblx != ''">
            and txzblx = #{dto.txzblx}
        </if>
        ${useSql}
        group by ssbmdm, ssbm
    </select>

    <select id="bmtj" resultType="java.util.Map">
        select ssbmdm, ssbm,count(1) as sl from mosty_qwgl.tb_qw_znzb where xt_sjzt='1' and xt_scbz='0' and
        ywid in(
        select id from mosty_qwgl.tb_qw_xfbb where  xt_sjzt='1' and xt_scbz='0'
        <if test="dto.kssj != null and dto.kssj != ''">
            and bbkssj >= #{dto.kssj}
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        )
        <if test="dto.txzblx != null and dto.txzblx != ''">
            and txzblx = #{dto.txzblx}
        </if>
        ${useSql}
        group by ssbmdm,ssbm order by sl desc
    </select>

    <select id="gzybmlbtj" resultType="java.util.Map">
        select ssbmdm, ssbm, COALESCE(SUM(sblx = '01'),0) as spjk,COALESCE(SUM(sblx = '02'),0) as
        jtkk from mosty_yszx.tb_ys_sxt where
        xt_sjzt = '1' and xt_scbz = '0' and sblx is not null
        <if test="dto.ssbmdm != nul and dto.ssbmdm != ''">
            and ssbmdm = #{dto.ssbmdm}
        </if>
        ${useSql}
        group by ssbmdm, ssbm
    </select>
</mapper>