forked from gzzfw/backEnd/gz-dyh

xusd
2024-09-21 0cda8b189c2c1a9d73280ae82aedcdffdee492e1
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -107,7 +107,10 @@
    <!-- 表 -->
    <sql id='table-name'>dyh_case_info</sql>
    <sql id="column-part-all">
        a.id,
        a
        .
        id
        ,
        a.status,
        a.status_name,
        a.canal,
@@ -131,7 +134,8 @@
    </sql>
    <!-- 字段 -->
    <sql id="column-part">
        id,
        id
        ,
        case_title,
        case_ref,
        case_level,
@@ -521,7 +525,8 @@
                </if>
                <if test="terms.processList != null and terms.processList.size > 0">
                    and process in
                    <foreach collection="terms.processList" item="process" index="index" open="(" separator="," close=")">
                    <foreach collection="terms.processList" item="process" index="index" open="(" separator=","
                             close=")">
                        #{process}
                    </foreach>
                </if>
@@ -652,6 +657,80 @@
    </select>
    <sql id="where-register-part">
        <if test="terms != null">
            <where>
                <if test="terms.inputUnitName != null and terms.inputUnitName !=''">
                    and t1.input_unit_mame = #{inputUnitName}
                </if>
                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
                    and (DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
                    and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
                </if>
                <if test="terms.caseLevel != null and terms.caseLevel !=''">
                    and t1.case_level = #{terms.caseLevel}
                </if>
                <if test="terms.caseTypeFirstName != null and terms.caseTypeFirstName !=''">
                    and t1.case_type_first_name = #{caseTypeFirstName}
                </if>
                <if test="terms.caseTypeName != null and terms.caseTypeName !=''">
                    and t1.case_type_name = #{terms.caseTypeName}
                </if>
                <if test="terms.canal != null and terms.canal !=''">
                    and t1.canal = #{canal}
                </if>
                <if test="terms.canalName != null and terms.canalName !=''">
                    and t1.canal_name = #{canalName}
                </if>
                <if test="terms.plaintiffs != null and terms.plaintiffs !=''">
                    and t1.plaintiffs = #{terms.plaintiffs}
                </if>
                <if test="terms.defendants != null and terms.defendants !=''">
                    and t1.defendants = #{terms.defendants}
                </if>
                <if test="terms.status != null and terms.status !=''">
                    and t1.status = #{terms.status}
                </if>
                <if test="terms.statusName != null and terms.statusName !=''">
                    and t1.statusName = #{terms.statusName}
                </if>
                <if test="terms.mediResultName != null and terms.mediResultName !=''">
                    and t2.medi_result_name = #{terms.mediResultName}
                </if>
            </where>
        </if>
    </sql>
    <select id="pageTermsCaseRegister" resultType="cn.huge.module.cases.domain.dto.CaseRegisterDTO">
        SELECT
        t1.create_time as createTime,t1.input_user_name as inputUserName,t1.status_name as statusName,t1.case_level as
        caseLevel,t1.canal_name as canalName,
        t1.case_type_first_name as caseTypeFirstName,t1.case_type_name as caseTypeName,t1.plaintiffs as
        plaintiffs,t1.defendants as defendants,t2.medi_result_name as mediResultName,
        t3.number as superviseCount
        FROM
        dyh_case_info t1 left join dyh_case_info_unfold t2 on t1.id = t2.id
        left join (select count(*) as number ,case_id from dyh_case_supervise group by case_id) t3 on t3.case_id=t1.id
        <include refid="where-register-part"/>
        <if test="page.sort != null">
            <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
                isnull(${s.property}), ${s.property} ${s.direction}
            </foreach>
        </if>
        <if test="page.sort == null">
            order by isnull(create_time), create_time desc
        </if>
        limit #{page.offset}, #{page.size}
    </select>
    <select id="countTermsCaseRegister" resultType="java.lang.Long" >
        SELECT
        count(t1.id)
        FROM
        dyh_case_info t1 left join dyh_case_info_unfold t2 on t1.id = t2.id
        <include refid="where-register-part"/>
    </select>
    <!--  根据条件统计  -->
    <select id="countTermsAll" resultType="java.lang.Long">
        select