RegisterParentsStudentMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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="org.dromara.system.mapper.RegisterParentsStudentMapper">
  6. <resultMap type="org.dromara.system.domain.vo.RegisterParentsStudentVo" id="RegisterParentsStudentResult">
  7. <result property="id" column="id" />
  8. <result property="parentsId" column="parents_id" />
  9. <result property="parentsName" column="parents_name" />
  10. <result property="parentsPhone" column="parents_phone" />
  11. <result property="schoolId" column="school_id" />
  12. <result property="schoolName" column="school_name" />
  13. <result property="classId" column="class_id" />
  14. <result property="className" column="class_name" />
  15. <result property="studentName" column="student_name" />
  16. <result property="studentNumber" column="student_number" />
  17. <result property="isPass" column="is_pass" />
  18. <result property="auditId" column="audit_id" />
  19. <result property="auditUser" column="audit_user" />
  20. <result property="opinion" column="opinion" />
  21. <result property="createBy" column="create_by" />
  22. <result property="createTime" column="create_time" />
  23. <result property="updateBy" column="update_by" />
  24. <result property="updateTime" column="update_time" />
  25. <result property="remark" column="remark" />
  26. </resultMap>
  27. <sql id="selectRegisterParentsStudentVo">
  28. select id, parents_id,parents_name,parents_phone, school_id, school_name, class_id, class_name, student_name, student_number, is_pass,audit_id,audit_user,opinion, create_by, create_time, update_by, update_time, remark from register_parents_student
  29. </sql>
  30. <update id="updateMapperById">
  31. update register_parents_student
  32. <trim prefix="SET" suffixOverrides=",">
  33. <if test="parentsId != null">parents_id = #{parentsId},</if>
  34. <if test="parentsName != null "> parents_name = #{parentsName},</if>
  35. <if test="parentsPhone != null "> parents_phone = #{parentsPhone},</if>
  36. <if test="schoolId != null">school_id = #{schoolId},</if>
  37. <if test="schoolName != null">school_name = #{schoolName},</if>
  38. <if test="classId != null">class_id = #{classId},</if>
  39. <if test="className != null">class_name = #{className},</if>
  40. <if test="studentName != null">student_name = #{studentName},</if>
  41. <if test="studentNumber != null">student_number = #{studentNumber},</if>
  42. <if test="isPass != null">is_pass = #{isPass},</if>
  43. <if test="auditId != null">audit_id= #{auditId},</if>
  44. <if test="auditUser != null">audit_user= #{auditUser},</if>
  45. <if test="opinion != null">opinion= #{opinion},</if>
  46. <if test="createBy != null">create_by = #{createBy},</if>
  47. <if test="createTime != null">create_time = #{createTime},</if>
  48. <if test="updateBy != null">update_by = #{updateBy},</if>
  49. <if test="updateTime != null">update_time = #{updateTime},</if>
  50. <if test="remark != null">remark = #{remark},</if>
  51. </trim>
  52. where id = #{id}
  53. </update>
  54. <delete id="deleteRegisterParentsStudentByParentsId" parameterType="java.lang.Long">
  55. delete from register_parents_student where parents_id = #{parentsId} and is_pass = '3';
  56. </delete>
  57. <delete id="deleteByIdMapper">
  58. delete from register_parents_student where id = #{id}
  59. </delete>
  60. <select id="selectRegisterParentsStudentListByTime" resultMap="RegisterParentsStudentResult">
  61. <include refid="selectRegisterParentsStudentVo"/>
  62. where date_format(create_time,'%Y%m') = date_format(#{monthFirst},'%Y%m')
  63. and class_id in
  64. <foreach collection="classIds" index="index" item="item" open="(" separator="," close=")">
  65. #{item}
  66. </foreach>
  67. </select>
  68. <select id="selectVoMapperList" resultMap="RegisterParentsStudentResult">
  69. <include refid="selectRegisterParentsStudentVo"/>
  70. ${ew.getCustomSqlSegment}
  71. </select>
  72. <select id="selectVoMapperPage" resultMap="RegisterParentsStudentResult">
  73. <include refid="selectRegisterParentsStudentVo"/>
  74. ${ew.getCustomSqlSegment}
  75. </select>
  76. </mapper>