heheng
2025-05-16 8485affcb0d4de05059d80cb1e844d6b18291654
src/main/resources/mapper/RiskPlanDataMapper.xml
@@ -8,4 +8,47 @@
        select id,identification_user identificationUser,identification_user_id identificationUserId from risk_assess_plan_identification_user
    </select>
    <select id="getPageCount" resultType="Long" parameterType="com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessQueryBO">
        select count(a.id) from (
        SELECT DISTINCT p.id as id FROM risk_assess_plan p
        <if test="userTag != null and userTag == 0">
            <if test="userId != null and tag != null and tag == 1">
                INNER JOIN risk_assess_plan_identification_user q ON p.id = q.risk_assess_plan_id AND q.delete_status = 0
                AND q.identification_user_id = #{userId}
            </if>
            <if test="userId != null and tag != null and tag == 2">
                INNER JOIN risk_assess_plan_evaluate_user h ON p.id = h.risk_assess_plan_id AND h.delete_status = 0 AND
                h.evaluate_user_id = #{userId}
            </if>
        </if>
        WHERE p.delete_status = 0
        <if test="experimentId != null">
            AND p.experiment_id = #{experimentId}
        </if>
        <if test="assessPlanName != null and assessPlanName != ''">
            AND p.assess_plan_name LIKE CONCAT('%',#{assessPlanName},'%')
        </if>
        <if test="tag != null and tag == 2">
            AND p.identification_time IS NOT NULL
        </if>
        <if test="tag != null and tag == 3">
            AND p.evaluate_time IS NOT NULL
        </if>
        <if test="planExecStatus != null and planExecStatus == 5">
            AND p.plan_exec_status >= 3
        </if>
        <if test="planExecStatus != null and planExecStatus != 5">
            AND p.plan_exec_status = #{planExecStatus}
        </if>
        <if test="planIds != null and !planIds.isEmpty()">
            AND p.id IN
            <foreach collection="planIds" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
        GROUP BY p.id
        ) a
    </select>
</mapper>