AlumniClubApplyMapper.xml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.AlumniClubApplyMapper">
  4. <resultMap type="com.template.model.vo.ApplyClubVo" id="ClubDataApplyMap">
  5. <result property="id" column="id"/>
  6. <result property="applyName" column="apply_name"/>
  7. <result property="collegeName" column="college_name"/>
  8. <result property="periodName" column="period_name"/>
  9. <result property="majorName" column="major_name"/>
  10. <result property="className" column="class_name"/>
  11. <result property="name" column="name"/>
  12. <result property="applyUserName" column="apply_user_name"/>
  13. <result property="isPass" column="is_pass"/>
  14. <result property="passTime" column="pass_time"/>
  15. <result property="createTime" column="create_time"/>
  16. <result property="passValue" column="pass_value"/>
  17. </resultMap>
  18. <select id="queryClubApplys" resultType="com.template.model.vo.ApplyClubVo" resultMap="ClubDataApplyMap">
  19. select aca.id,au.name as apply_name,au.college_name,au.period_name,au.major_name,au.class_name,aca.name,aca.is_pass,aca.update_time as pass_time,aca.create_time,aca.pass_value
  20. from alumni_club_apply aca
  21. inner join alumni_user au on au.deleted = 0 and au.id = aca.create_user
  22. <if test="applyUsername != null and applyUsername != ''">
  23. and au.name like '%' #{applyUsername} '%'
  24. </if>
  25. <if test="collegeId != null and collegeId != 0">
  26. and au.college_id = #{collegeId}
  27. </if>
  28. <if test="periodId != null and periodId != 0">
  29. and au.period_id = #{periodId}
  30. </if>
  31. <if test="majorId != null and majorId != 0">
  32. and au.major_id = #{majorId}
  33. </if>
  34. <if test="classId != null and classId != 0">
  35. and au.class_id = #{classId}
  36. </if>
  37. where aca.deleted= 0
  38. <if test="name != null and name != ''">
  39. and aca.name like '%' #{name} '%'
  40. </if>
  41. <if test="isPass != null and isPass != 0">
  42. and aca.is_pass = #{isPass}
  43. </if>
  44. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  45. and aca.create_time BETWEEN #{startTime} AND #{endTime}
  46. </if>
  47. <if test="userId != null and userId != 0">
  48. and FIND_IN_SET(#{userId},aca.apply_user)
  49. </if>
  50. </select>
  51. <select id="queryMyClubApplys" resultType="com.template.model.vo.ApplyClubVo" resultMap="ClubDataApplyMap">
  52. select aca.club_id as id,au.name as apply_name,au.college_name,au.period_name,au.major_name,au.class_name,aca.name,aca.is_pass,aca.update_time as pass_time,aca.create_time,aca.pass_value
  53. from alumni_club_apply aca
  54. inner join alumni_user au on au.deleted = 0 and au.id = aca.create_user
  55. where aca.deleted= 0
  56. <if test="name != null and name != ''">
  57. and aca.name like '%' #{name} '%'
  58. </if>
  59. <if test="userId != null and userId != 0">
  60. and aca.create_user = #{userId}
  61. </if>
  62. </select>
  63. <select id="queryApproveClubApplys" resultType="com.template.model.vo.ApplyClubVo" resultMap="ClubDataApplyMap">
  64. select aca.club_id as id,au.name as apply_name,au.college_name,au.period_name,au.major_name,au.class_name,aca.name,aca.is_pass,aca.update_time as pass_time,aca.create_time,aca.pass_value
  65. from alumni_club_apply aca
  66. inner join alumni_user au on au.deleted = 0 and au.id = aca.create_user
  67. where aca.deleted= 0 and aca.is_pass = 1
  68. <if test="name != null and name != ''">
  69. and aca.name like '%' #{name} '%'
  70. </if>
  71. <if test="userId != null and userId != 0">
  72. and FIND_IN_SET(#{userId},aca.apply_user)
  73. </if>
  74. order by aca.create_time desc
  75. </select>
  76. </mapper>