heheng
2025-05-16 8485affcb0d4de05059d80cb1e844d6b18291654
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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.gkhy.labRiskManage.mapper.RiskPlanDataMapper">
 
    <select id="pageList" resultType="com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationUser">
        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>