SmartAuthorGroupMapper.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.template.mapper.SmartAuthorGroupMapper">
  4. <resultMap type="com.template.model.pojo.SmartAuthorGroup" id="smartAuthorGroupMap">
  5. <result property="id" column="id"/>
  6. <result property="parentId" column="parent_id"/>
  7. <result property="name" column="name"/>
  8. <result property="userId" column="user_id"/>
  9. <result property="applyId" column="apply_id"/>
  10. </resultMap>
  11. <resultMap type="com.template.model.pojo.SmartAuthorGroupManager" id="smartAuthorGroupManager">
  12. <result property="groupId" column="group_id"/>
  13. <result property="userId" column="user_id"/>
  14. <result property="cardNo" column="card_no"/>
  15. <result property="userName" column="user_name"/>
  16. <result property="departmentManage" column="department_manage"/>
  17. <result property="departmentView" column="department_view"/>
  18. </resultMap>
  19. <select id="smartAuthorGroup" resultType="com.template.model.pojo.SmartAuthorGroup" resultMap="smartAuthorGroupMap">
  20. SELECT * FROM `smart_author_group`
  21. where deleted = 0
  22. <if test="userId != null and userId != ''">
  23. and FIND_IN_SET(#{userId},user_id)
  24. </if>
  25. </select>
  26. <select id="smartAuthorGroupSuperAdmin" resultType="com.template.model.pojo.SmartAuthorGroup" resultMap="smartAuthorGroupMap">
  27. SELECT * FROM `smart_author_group`
  28. where deleted = 0 and parent_id = 0
  29. <if test="userId != null and userId != ''">
  30. and FIND_IN_SET(#{userId},user_id)
  31. </if>
  32. </select>
  33. <select id="getSmartAuthorGroupManager" resultType="com.template.model.pojo.SmartAuthorGroupManager" resultMap="smartAuthorGroupManager">
  34. select a.`id`,a.`group_id`,a.`user_id`,b.card_no,b.`name` as user_name,a.`department_manage`,a.`department_view`
  35. from `smart_authority` a left join `smart_user` b on a.`user_id`=b.id
  36. where group_id=#{groupId} and a.deleted=0 and b.deleted=0
  37. </select>
  38. </mapper>