SysPostMapper.xml 1012 B

1234567891011121314151617181920212223242526272829
  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="org.dromara.system.mapper.SysPostMapper">
  6. <resultMap type="org.dromara.system.domain.vo.SysPostVo" id="SysPostResult">
  7. </resultMap>
  8. <select id="selectPagePostList" resultMap="SysPostResult">
  9. select
  10. <if test="ew.getSqlSelect != null">
  11. ${ew.getSqlSelect}
  12. </if>
  13. <if test="ew.getSqlSelect == null">
  14. *
  15. </if>
  16. from sys_post ${ew.getCustomSqlSegment}
  17. </select>
  18. <select id="selectPostsByUserId" parameterType="Long" resultMap="SysPostResult">
  19. select p.post_id, p.dept_id, p.post_name, p.post_code, p.post_category
  20. from sys_post p
  21. left join sys_user_post up on up.post_id = p.post_id
  22. left join t_sys_user u on u.user_id = up.user_id
  23. where u.user_id = #{userId}
  24. </select>
  25. </mapper>