CourseScheduleComplaintsMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. <!--
  4. 这个文件是自动生成的。
  5. 不要修改此文件。所有改动将在下次重新自动生成时丢失。
  6. -->
  7. <mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao">
  8. <resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" id="CourseScheduleComplaints">
  9. <result column="id_" property="id" />
  10. <result column="user_id_" property="userId" />
  11. <result column="course_schedule_id_" property="courseScheduleId" />
  12. <result column="reason_" property="reason" />
  13. <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
  14. <result column="wf_process_id_" property="wfProcessId" />
  15. <result column="wf_order_id_" property="wfOrderId" />
  16. <result column="teacher_liability_ratio_" property="teacherLiabilityRatio" />
  17. <result column="student_liability_ratio_" property="studentLiabilityRatio" />
  18. <result column="create_time_" property="createTime" />
  19. <result column="update_time_" property="updateTime" />
  20. </resultMap>
  21. <!-- 根据主键查询一条记录 -->
  22. <select id="get" resultMap="CourseScheduleComplaints" >
  23. SELECT * FROM course_schedule_complaints WHERE id_ = #{id}
  24. </select>
  25. <!-- 全查询 -->
  26. <select id="findAll" resultMap="CourseScheduleComplaints">
  27. SELECT * FROM course_schedule_complaints ORDER BY id_
  28. </select>
  29. <!-- 向数据库增加一条记录 -->
  30. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  31. <!--
  32. <selectKey resultClass="int" keyProperty="id" >
  33. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  34. </selectKey>
  35. -->
  36. INSERT INTO course_schedule_complaints (id_,user_id_,course_schedule_id_,reason_,status_,wf_process_id_,wf_order_id_,create_time_,update_time_,teacher_liability_ratio_,student_liability_ratio_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio})
  37. </insert>
  38. <!-- 根据主键查询一条记录 -->
  39. <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints">
  40. UPDATE course_schedule_complaints
  41. <set>
  42. <if test="status != null">
  43. status_ = #{status, typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
  44. </if>
  45. <if test="wfOrderId != null">
  46. wf_order_id_ = #{wfOrderId},
  47. </if>
  48. <if test="userId != null">
  49. user_id_ = #{userId},
  50. </if>
  51. <if test="wfProcessId != null">
  52. wf_process_id_ = #{wfProcessId},
  53. </if>
  54. <if test="id != null">
  55. id_ = #{id},
  56. </if>
  57. <if test="courseScheduleId != null">
  58. course_schedule_id_ = #{courseScheduleId},
  59. </if>
  60. <if test="reason != null">
  61. reason_ = #{reason},
  62. </if>
  63. <if test="updateTime != null">
  64. update_time_ = now(),
  65. </if>
  66. <if test="teacherLiabilityRatio != null">
  67. teacher_liability_ratio_ = #{teacherLiabilityRatio},
  68. </if>
  69. <if test="studentLiabilityRatio != null">
  70. student_liability_ratio_ = #{studentLiabilityRatio},
  71. </if>
  72. </set> WHERE id_ = #{id}
  73. </update>
  74. <!-- 根据主键删除一条记录 -->
  75. <delete id="delete" >
  76. DELETE FROM course_schedule_complaints WHERE id_ = #{id}
  77. </delete>
  78. <!-- 分页查询 -->
  79. <select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
  80. SELECT * FROM course_schedule_complaints ORDER BY id_ <include refid="global.limit"/>
  81. </select>
  82. <!-- 查询当前表的总记录数 -->
  83. <select id="queryCount" resultType="int">
  84. SELECT COUNT(*) FROM course_schedule_complaints
  85. </select>
  86. <select id="findByUserAndCourse" resultMap="CourseScheduleComplaints">
  87. SELECT * FROM course_schedule_complaints WHERE user_id_=#{userId} AND course_schedule_id_=#{courseScheduleId}
  88. </select>
  89. <select id="findByCourseScheduleIds" resultMap="CourseScheduleComplaints">
  90. SELECT * FROM course_schedule_complaints WHERE course_schedule_id_ IN
  91. <foreach collection="ids" item="id" open="(" close=")" separator=",">
  92. #{id}
  93. </foreach>
  94. </select>
  95. </mapper>