教育训练处考试制证系统后端
“djh”
2025-04-24 f9cb0f3f384279b2cbe87c35dde3ba573a0197f3
exam-system/src/main/resources/mapper/pay/NonCoalCategoryMapper.xml
@@ -199,32 +199,32 @@
    </select>
    <select id="selectCountCategory" resultType="com.gkhy.exam.pay.dto.rep.NonCategoryCount">
        SELECT
            cc.id,
            sot.name as subject_name,
            cc.amount,
            cc.category_type,
            COUNT( cps.`name` ) num
            cc.operate_type_id,
            MAX(sot.name) AS subject_name,
            MAX(cc.amount) AS amount,
            MAX(cc.category_type) AS category_type,
            COUNT(cps.id) AS num
        FROM
            non_coal_category cc
                LEFT JOIN sys_operate_type sot on cc.operate_type_id = sot.id
                LEFT JOIN non_coal_pay_category cpc ON cc.id = cpc.category_id
                LEFT JOIN non_coal_pay cp ON cpc.non_coal_pay_id = cp.id
                LEFT JOIN non_coal_pay_student cps ON cp.id = cps.non_coal_pay_id
        WHERE cc.category_type = 2 and cc.del_flag = 0 and cps.del_flag =0 and cp.del_flag = 0 and cps.pay_status = 1
            LEFT JOIN sys_operate_type sot ON cc.operate_type_id = sot.id
            LEFT JOIN non_coal_pay_category cpc ON cc.id = cpc.category_id
            LEFT JOIN non_coal_pay cp ON cpc.non_coal_pay_id = cp.id AND cp.del_flag = 0
            LEFT JOIN non_coal_pay_student cps ON cp.id = cps.non_coal_pay_id
        WHERE cc.category_type = 2 and cc.del_flag = 0 and  cp.del_flag = 0 AND cps.del_flag = 0 AND cps.pay_status = 1
        <if test="year!=null and year !=''">
            and cp.year =#{year}
        </if>
        <if test="quarter != null">
            and cp.quarter = #{quarter}
        </if>
        <if test="districtCode!=null and districtCode!=''">
        <if test="districtCode!=null and districtCode!='' and districtCode != 65">
            and cc.district_code =#{districtCode}
        </if>
        <if test="deptId!=null">
            and cp.dept_id =#{deptId}
        </if>
        GROUP BY
            cc.id
            cc.operate_type_id
    </select>
    <select id="selectCountTheory" resultType="com.gkhy.exam.pay.dto.rep.CateGoryTheory">
        WITH filtered_data AS (
@@ -245,7 +245,7 @@
            <if test="quarter!=null">
                and cp.quarter = #{quarter}
            </if>
            <if test="districtCode !=null and districtCode !=''">
            <if test="districtCode !=null and districtCode !='' and districtCode != 65 ">
                and cp.district_code = #{districtCode}
            </if>
            <if test="deptId!=null">