CompanyUserChangeApplyMapper.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.fs.company.mapper.CompanyUserChangeApplyMapper">
  6. <resultMap id="applyMap" type="CompanyUserChangeApplyVO">
  7. </resultMap>
  8. <sql id="applySQL">
  9. select
  10. cuca.*,
  11. fu.avatar fromAvatar,
  12. fu.user_name fromName,
  13. tu.avatar toAvatar,
  14. tu.user_name toName
  15. from company_user_change_apply cuca
  16. left join company_user fu on fu.user_id = cuca.`from`
  17. left join company_user tu on tu.user_id = cuca.`to`
  18. </sql>
  19. <!-- 查询申请列表 -->
  20. <select id="selectApplyListByMap" resultMap="applyMap">
  21. <include refid="applySQL"/>
  22. <where>
  23. <if test="map.status != null">
  24. cuca.status = #{map.status}
  25. </if>
  26. <if test="map.companyId != null">
  27. and cuca.company_id = #{map.companyId}
  28. </if>
  29. </where>
  30. </select>
  31. <!-- 查询申请详情 -->
  32. <select id="detailById" resultMap="applyMap">
  33. <include refid="applySQL"/>
  34. where cuca.id = #{id}
  35. </select>
  36. </mapper>