puzhibing
6 天以前 fccb84b175884930aacfa3531c5bdb4333f8c851
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
<?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.TProjectTeamMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TProjectTeam">
        <id column="id" property="id" />
        <result column="team_name" property="teamName" />
        <result column="person_charge" property="personCharge" />
        <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, team_name, person_charge, status, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TProjectTeamVO">
        SELECT
        <include refid="Base_Column_List" />
        FROM t_project_team
        <where>
            <if test="query.teamName != null and query.teamName != ''">
                AND team_name LIKE CONCAT('%', #{query.teamName}, '%')
            </if>
            <if test="query.personCharge != null and query.personCharge != ''">
                AND person_charge LIKE CONCAT('%', #{query.personCharge}, '%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
 
            <if test="query.projectIds != null and query.projectIds.size()>0">
                AND id IN
                <foreach collection="query.projectIds" close=")" open="(" item="id" separator=",">
                    #{id}
                </foreach>
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="choiceProjectList" resultType="com.ruoyi.system.vo.TProjectTeamVO">
        select * from t_project_team
        <where>
            <if test="query.projectIds != null and query.projectIds.size() > 0">
                AND id NOT IN (
                <foreach collection="query.projectIds" item="item" separator=",">
                    #{item}
                </foreach>
                )
            </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
    </select>
 
</mapper>