AlumniUserMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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.AlumniUserMapper">
  4. <resultMap id="queryUserMaps" type="com.template.model.vo.ListDataVO">
  5. <result property="id" column="id"/>
  6. <result property="name" column="name"/>
  7. </resultMap>
  8. <select id="queryUsers" resultMap="queryUserMaps">
  9. select id,name from alumni_user
  10. where deleted = 0 and account is not null
  11. <if test="keyword != null and keyword != ''">
  12. and name like '%' #{keyword} '%'
  13. </if>
  14. </select>
  15. <resultMap type="com.template.model.vo.UserVo" id="UserPageMap">
  16. <result property="id" column="id"/>
  17. <result property="cardNo" column="card_number"/>
  18. <result property="name" column="name"/>
  19. </resultMap>
  20. <select id="queryUserPages" resultType="com.template.model.vo.UserVo" resultMap="UserPageMap">
  21. select
  22. id,card_number,name
  23. from alumni_user
  24. where deleted = 0
  25. <if test="departmentIds != null and departmentIds.size() > 0">
  26. and org_id in
  27. <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
  28. ${departmentId}
  29. </foreach>
  30. </if>
  31. </select>
  32. </mapper>