| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <!--
- 这个文件是自动生成的。
- 不要修改此文件。所有改动将在下次重新自动生成时丢失。
- -->
- <mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao">
-
- <resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" id="CourseScheduleComplaints">
- <result column="id_" property="id" />
- <result column="user_id_" property="userId" />
- <result column="course_schedule_id_" property="courseScheduleId" />
- <result column="reason_" property="reason" />
- <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
- <result column="wf_process_id_" property="wfProcessId" />
- <result column="wf_order_id_" property="wfOrderId" />
- <result column="teacher_liability_ratio_" property="teacherLiabilityRatio" />
- <result column="student_liability_ratio_" property="studentLiabilityRatio" />
- <result column="create_time_" property="createTime" />
- <result column="update_time_" property="updateTime" />
- </resultMap>
-
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="CourseScheduleComplaints" >
- SELECT * FROM course_schedule_complaints WHERE id_ = #{id}
- </select>
-
- <!-- 全查询 -->
- <select id="findAll" resultMap="CourseScheduleComplaints">
- SELECT * FROM course_schedule_complaints ORDER BY id_
- </select>
-
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <!--
- <selectKey resultClass="int" keyProperty="id" >
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
- </selectKey>
- -->
- 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})
- </insert>
-
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints">
- UPDATE course_schedule_complaints
- <set>
- <if test="status != null">
- status_ = #{status, typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
- </if>
- <if test="wfOrderId != null">
- wf_order_id_ = #{wfOrderId},
- </if>
- <if test="userId != null">
- user_id_ = #{userId},
- </if>
- <if test="wfProcessId != null">
- wf_process_id_ = #{wfProcessId},
- </if>
- <if test="id != null">
- id_ = #{id},
- </if>
- <if test="courseScheduleId != null">
- course_schedule_id_ = #{courseScheduleId},
- </if>
- <if test="reason != null">
- reason_ = #{reason},
- </if>
- <if test="updateTime != null">
- update_time_ = now(),
- </if>
- <if test="teacherLiabilityRatio != null">
- teacher_liability_ratio_ = #{teacherLiabilityRatio},
- </if>
- <if test="studentLiabilityRatio != null">
- student_liability_ratio_ = #{studentLiabilityRatio},
- </if>
- </set> WHERE id_ = #{id}
- </update>
-
- <!-- 根据主键删除一条记录 -->
- <delete id="delete" >
- DELETE FROM course_schedule_complaints WHERE id_ = #{id}
- </delete>
-
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
- SELECT * FROM course_schedule_complaints ORDER BY id_ <include refid="global.limit"/>
- </select>
-
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(*) FROM course_schedule_complaints
- </select>
- <select id="findByUserAndCourse" resultMap="CourseScheduleComplaints">
- SELECT * FROM course_schedule_complaints WHERE user_id_=#{userId} AND course_schedule_id_=#{courseScheduleId}
- </select>
- <select id="findByCourseScheduleIds" resultMap="CourseScheduleComplaints">
- SELECT * FROM course_schedule_complaints WHERE course_schedule_id_ IN
- <foreach collection="ids" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </select>
- </mapper>
|