SysPostMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~
  4. ~ Copyright (c) 2018-2025, lengleng All rights reserved.
  5. ~
  6. ~ Redistribution and use in source and binary forms, with or without
  7. ~ modification, are permitted provided that the following conditions are met:
  8. ~
  9. ~ Redistributions of source code must retain the above copyright notice,
  10. ~ this list of conditions and the following disclaimer.
  11. ~ Redistributions in binary form must reproduce the above copyright
  12. ~ notice, this list of conditions and the following disclaimer in the
  13. ~ documentation and/or other materials provided with the distribution.
  14. ~ Neither the name of the pig4cloud.com developer nor the names of its
  15. ~ contributors may be used to endorse or promote products derived from
  16. ~ this software without specific prior written permission.
  17. ~ Author: lengleng ([email protected])
  18. ~
  19. -->
  20. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  21. <mapper namespace="com.pig4cloud.pig.admin.mapper.SysPostMapper">
  22. <resultMap id="sysPostMap" type="com.pig4cloud.pig.admin.api.entity.SysPost">
  23. <id property="postId" column="post_id"/>
  24. <result property="postCode" column="post_code"/>
  25. <result property="postName" column="post_name"/>
  26. <result property="postSort" column="post_sort"/>
  27. <result property="delFlag" column="del_flag"/>
  28. <result property="createTime" column="create_time"/>
  29. <result property="updateTime" column="update_time"/>
  30. <result property="remark" column="remark"/>
  31. </resultMap>
  32. <!-- 通过用户ID,查询岗位信息-->
  33. <select id="listPostsByUserId" resultType="com.pig4cloud.pig.admin.api.entity.SysPost">
  34. SELECT p.post_id,
  35. p.post_name,
  36. p.post_code,
  37. p.post_sort,
  38. p.del_flag,
  39. p.create_time,
  40. p.update_time,
  41. p.remark
  42. FROM sys_post p,
  43. sys_user_post up
  44. WHERE p.post_id = up.post_id
  45. AND p.del_flag = '0'
  46. and up.user_id = #{userId}
  47. </select>
  48. </mapper>