xuhy
1 天以前 4e0b0be90a8bf14a59f4cfee7959534adea24ba3
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
<?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.TProjectDeptMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TProjectDept">
        <id column="id" property="id" />
        <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" />
        <result column="project_name" property="projectName" />
        <result column="parent_id" property="parentId" />
        <result column="status" property="status" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, create_time, update_time, create_by, update_by, disabled, project_name, parent_id, status
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.system.ProjectDeptListVO">
        select t1.*,count(t2.user_id) as userCount from
        t_project_dept t1
        left join sys_user t2 on t2.deptId = t1.id and t2.deptType =1
        where 1=1
        <if test="query.deptName != null and query.deptName != ''">
            and t1.project_name like concat('%',#{query.deptName},'%')
        </if>
        <if test="query.status != null and query.status != ''">
            and t1.status = #{query.status}
        </if>
        and t1.`disabled`  = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        and t1.parent_id = 0
        group by t1.id
        order by t1.create_time desc
    </select>
 
</mapper>