CompanyUserChangeApplyMapper.xml 1.2 KB

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