xuhy
8 天以前 61d85c788d4d966886617ccdf3335c6a55896878
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
<?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.ruoyi.system.mapper.TInspectionReportMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TInspectionReport">
        <id column="id" property="id" />
        <result column="dispatch_id" property="dispatchId" />
        <result column="test_result" property="testResult" />
        <result column="test_reason" property="testReason" />
        <result column="status" property="status" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, dispatch_id, test_result, test_reason, status, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TInspectionReportVO">
        select id, dispatch_id, test_result, test_reason, status, create_time, update_time, create_by, update_by, disabled
        from t_inspection_report tir
        left join t_experiment_dispatch ted on ted.id = tir.dispatch_id
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        <where>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%', #{query.projectName}, '%')
            </if>
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%', #{query.experimentName}, '%')
            </if>
            <if test="query.experimentCode != null and query.experimentCode !=''">
                and ted.experiment_code like concat('%', #{query.experimentCode}, '%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tir.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
                and tir.status = #{query.status}
            </if>
            <if test="query.createBy != null and query.createBy != ''">
                and tir.create_by = #{query.createBy}
            </if>
            and tir.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tir.create_time DESC
    </select>
 
</mapper>