xuhy
2025-04-12 77a409bdbaa1ed9f8ac7829f6ffbb7521e61f854
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
55
56
57
58
59
60
61
62
63
64
65
<?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.TProjectProposalMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TProjectProposal">
        <id column="id" property="id" />
        <result column="project_name" property="projectName" />
        <result column="project_stage" property="projectStage" />
        <result column="project_code" property="projectCode" />
        <result column="experiment_objective" property="experimentObjective" />
        <result column="experiment_material" property="experimentMaterial" />
        <result column="experiment_device" property="experimentDevice" />
        <result column="experiment_test_method" property="experimentTestMethod" />
        <result column="experiment_procedure" property="experimentProcedure" />
        <result column="data_acquisition" property="dataAcquisition" />
        <result column="result_evaluation" property="resultEvaluation" />
        <result column="precautions" property="precautions" />
        <result column="audit_status" property="auditStatus" />
        <result column="audit_person_id" property="auditPersonId" />
        <result column="audit_time" property="auditTime" />
        <result column="audit_remark" property="auditRemark" />
        <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, project_name, project_stage, project_code, experiment_objective, experiment_material, experiment_device, experiment_test_method, experiment_procedure, data_acquisition, result_evaluation, precautions, audit_status, audit_person_id, audit_time, audit_remark, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TProjectProposalVO">
        select tpp.id, tpp.project_name, tpp.project_stage, tpp.project_code, tpp.experiment_objective, tpp.experiment_material, tpp.experiment_device,
        tpp.experiment_test_method, tpp.experiment_procedure, tpp.data_acquisition, tpp.result_evaluation, tpp.precautions, tpp.audit_status,
        tpp.audit_person_id, tpp.audit_time, tpp.audit_remark, tpp.create_time, tpp.update_time, tpp.create_by, tpp.update_by, tpp.disabled,
        su.nickname as auditPersonName
        from t_project_proposal tpp
        left join sys_user su on su.user_id = tpp.audit_person_id
        <where>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%',#{query.projectName},'%')
            </if>
            <if test="query.projectCode != null and query.projectCode != ''">
                and tpp.project_code like concat('%',#{query.projectCode},'%')
            </if>
            <if test="query.auditPersonName != null and query.auditPersonName != ''">
                and su.nickname like concat('%',#{query.auditPersonName},'%')
            </if>
            <if test="query.createBy != null and query.createBy != ''">
                and tpp.createBy like concat('%',#{query.createBy},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tpp.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.auditStatus != null">
                AND tpp.audit_status = #{query.auditStatus}
            </if>
            AND tpp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tpp.create_time DESC
    </select>
 
</mapper>