SysDeptInternalAgentMapper.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.admin.dao.SysDeptInternalAgentMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysDeptInternalAgent">
  7. <id property="id" column="id" jdbcType="VARCHAR"/>
  8. <result property="name" column="name" jdbcType="VARCHAR"/>
  9. <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
  10. <result property="orderNum" column="order_num" jdbcType="INTEGER"/>
  11. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  12. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  13. <result property="lastUpdateBy" column="last_update_by" jdbcType="VARCHAR"/>
  14. <result property="lastUpdateTime" column="last_update_time" jdbcType="TIMESTAMP"/>
  15. <result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
  16. <result property="comtype" column="comtype" jdbcType="VARCHAR"/>
  17. <result property="comlevel" column="comlevel" jdbcType="VARCHAR"/>
  18. <result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
  19. </resultMap>
  20. <sql id="Base_Column_List">
  21. id,name,parent_id,
  22. order_num,create_by,create_time,
  23. last_update_by,last_update_time,del_flag,
  24. comtype,comlevel,dept_code
  25. </sql>
  26. <select id="queryDeptList" resultType="com.ydtech.modules.admin.model.po.SysDeptInternalAgent">
  27. select * from sys_dept_internal_agent
  28. <where>
  29. <if test="comtype != null and comtype != ''">
  30. AND comtype = #{comtype}
  31. </if>
  32. <if test="parentIds != null and parentIds != ''">
  33. AND parent_ids like concat(#{parentIds},'%')
  34. </if>
  35. </where>
  36. </select>
  37. <select id="queryGroupListByDeptId" resultType="com.ydtech.modules.admin.model.dto.GroupDto">
  38. SELECT
  39. t4.id AS deptId,
  40. t4.NAME AS deptName
  41. FROM
  42. sys_dept_internal_agent t3
  43. LEFT JOIN sys_dept_internal_agent t4 ON t4.parent_id = t3.id
  44. LEFT JOIN sys_dept dept on t3.bind_dept_id = dept.id
  45. <where>
  46. <if test="comtype != null and comtype != ''">
  47. AND t4.comtype = #{comtype}
  48. </if>
  49. <if test="deptId != null and deptId != ''">
  50. AND t3.bind_dept_id like concat(#{deptId},'%')
  51. </if>
  52. </where>
  53. </select>
  54. </mapper>