AlumniUserMapper.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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="cardNumber" 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 and role_id is not null
  25. <if test="departmentIds != null and departmentIds.size() > 0">
  26. and (college_id in
  27. <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
  28. ${departmentId}
  29. </foreach>
  30. or
  31. period_id in
  32. <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
  33. ${departmentId}
  34. </foreach>
  35. or
  36. major_id in
  37. <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
  38. ${departmentId}
  39. </foreach>
  40. or
  41. class_id in
  42. <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
  43. ${departmentId}
  44. </foreach>
  45. )
  46. </if>
  47. order by create_time desc
  48. </select>
  49. </mapper>