xiangpei
2024-11-29 07c4ad96c75dc93b39e002feb19845219fede415
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
66
67
68
69
70
71
72
73
74
75
76
77
<?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.ycl.mapper.ProjectProcessMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectProcessVO">
        <id column="id" property="id"/>
        <result column="project_name" property="projectName" />
        <result column="project_code" property="projectCode" />
        <result column="content" property="content" />
        <result column="project_type" property="projectType" />
        <result column="project_status" property="projectStatus" />
        <result column="fund_type" property="fundType" />
        <result column="invest_type" property="investType" />
        <result column="project_phase" property="projectPhase" />
        <result column="tag" property="tag" />
<!--        <result column="competent_department" property="competentDepartment" />-->
        <result column="area_code" property="areaCode" />
<!--        <result column="management_centralization" property="managementCentralization" />-->
        <result column="project_approval_type" property="projectApprovalType" />
        <result column="importance_type" property="importanceType" />
        <result column="year" property="year" />
        <result column="year_invest_amount" property="yearInvestAmount" />
        <result column="create_project_time" property="createProjectTime" />
        <result column="plan_start_time" property="planStartTime" />
        <result column="plan_complete_time" property="planCompleteTime" />
        <result column="win_unit" property="winUnit" />
        <result column="win_amount" property="winAmount" />
        <result column="win_time" property="winTime" />
        <result column="project_address" property="projectAddress" />
        <result column="longitude" property="longitude" />
        <result column="latitude" property="latitude" />
        <result column="project_owner_unit" property="projectOwnerUnit" />
        <result column="project_contact_person" property="projectContactPerson" />
        <result column="contact" property="contact" />
        <result column="gmt_create_time" property="gmtCreateTime" />
        <result column="gmt_update_time" property="gmtUpdateTime" />
        <result column="update_by" property="updateBy" />
        <result column="create_by" property="createBy" />
        <result column="process_def_id" property="processDefId" />
<!--        <association property="id" column=""-->
    </resultMap>
 
 
 
 
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            TPP.project_id,
            TPP.process_def_id,
            TPP.id
        FROM
            t_project_process TPP
        WHERE
            TPP.id = #{id} AND TPP.deleted = 0
    </select>
 
 
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            PI.*,
            TPP.process_def_id
        FROM
            t_project_info PI
                LEFT JOIN t_project_process TPP ON TPP.project_id = PI.id AND TPP.deleted = 0 AND PI.deleted = 0
        <where>
            <if test="query.projectName != null and query.projectName != ''">
                AND PI.project_name like concat('%', #{query.projectName}, '%')
            </if>
            <if test="query.projectCode != null and query.projectCode != ''">
                AND PI.project_code like concat('%', #{query.projectCode}, '%')
            </if>
        </where>
 
    </select>
 
</mapper>