| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?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.ydtech.modules.admin.dao.SysDeptInternalAgentMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysDeptInternalAgent">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
- <result property="orderNum" column="order_num" jdbcType="INTEGER"/>
- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="lastUpdateBy" column="last_update_by" jdbcType="VARCHAR"/>
- <result property="lastUpdateTime" column="last_update_time" jdbcType="TIMESTAMP"/>
- <result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
- <result property="comtype" column="comtype" jdbcType="VARCHAR"/>
- <result property="comlevel" column="comlevel" jdbcType="VARCHAR"/>
- <result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,name,parent_id,
- order_num,create_by,create_time,
- last_update_by,last_update_time,del_flag,
- comtype,comlevel,dept_code
- </sql>
- <select id="queryDeptList" resultType="com.ydtech.modules.admin.model.po.SysDeptInternalAgent">
- select * from sys_dept_internal_agent
- <where>
- <if test="comtype != null and comtype != ''">
- AND comtype = #{comtype}
- </if>
- <if test="parentIds != null and parentIds != ''">
- AND parent_ids like concat(#{parentIds},'%')
- </if>
- </where>
- </select>
- <select id="queryGroupListByDeptId" resultType="com.ydtech.modules.admin.model.dto.GroupDto">
- SELECT
- t4.id AS deptId,
- t4.NAME AS deptName
- FROM
- sys_dept_internal_agent t3
- LEFT JOIN sys_dept_internal_agent t4 ON t4.parent_id = t3.id
- LEFT JOIN sys_dept dept on t3.bind_dept_id = dept.id
- <where>
- <if test="comtype != null and comtype != ''">
- AND t4.comtype = #{comtype}
- </if>
- <if test="deptId != null and deptId != ''">
- AND t3.bind_dept_id like concat(#{deptId},'%')
- </if>
- </where>
- </select>
- </mapper>
|