|
@@ -5,7 +5,7 @@
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
-->
|
|
-->
|
|
<mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao">
|
|
<mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" id="CourseScheduleComplaints">
|
|
<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" id="CourseScheduleComplaints">
|
|
<result column="id_" property="id" />
|
|
<result column="id_" property="id" />
|
|
<result column="user_id_" property="userId" />
|
|
<result column="user_id_" property="userId" />
|
|
@@ -20,27 +20,27 @@
|
|
<result column="update_time_" property="updateTime" />
|
|
<result column="update_time_" property="updateTime" />
|
|
<result column="score_" property="score" />
|
|
<result column="score_" property="score" />
|
|
</resultMap>
|
|
</resultMap>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
<select id="get" resultMap="CourseScheduleComplaints" >
|
|
<select id="get" resultMap="CourseScheduleComplaints" >
|
|
- SELECT * FROM course_schedule_complaints WHERE id_ = #{id}
|
|
|
|
|
|
+ SELECT * FROM course_schedule_complaints WHERE id_ = #{id}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 全查询 -->
|
|
<!-- 全查询 -->
|
|
<select id="findAll" resultMap="CourseScheduleComplaints">
|
|
<select id="findAll" resultMap="CourseScheduleComplaints">
|
|
SELECT * FROM course_schedule_complaints ORDER BY id_
|
|
SELECT * FROM course_schedule_complaints ORDER BY id_
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 向数据库增加一条记录 -->
|
|
<!-- 向数据库增加一条记录 -->
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
<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 resultClass="int" keyProperty="id" >
|
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
</selectKey>
|
|
</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_,score_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio},#{score})
|
|
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_,score_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio},#{score})
|
|
</insert>
|
|
</insert>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints">
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints">
|
|
UPDATE course_schedule_complaints
|
|
UPDATE course_schedule_complaints
|
|
@@ -80,10 +80,10 @@
|
|
</if>
|
|
</if>
|
|
</set> WHERE id_ = #{id}
|
|
</set> WHERE id_ = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 根据主键删除一条记录 -->
|
|
<!-- 根据主键删除一条记录 -->
|
|
<delete id="delete" >
|
|
<delete id="delete" >
|
|
- DELETE FROM course_schedule_complaints WHERE id_ = #{id}
|
|
|
|
|
|
+ DELETE FROM course_schedule_complaints WHERE id_ = #{id}
|
|
</delete>
|
|
</delete>
|
|
<delete id="delByCourseScheduleId">
|
|
<delete id="delByCourseScheduleId">
|
|
DELETE FROM course_schedule_complaints WHERE course_schedule_id_ = #{courseScheduleId}
|
|
DELETE FROM course_schedule_complaints WHERE course_schedule_id_ = #{courseScheduleId}
|
|
@@ -99,7 +99,7 @@
|
|
<select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
|
|
<select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
|
|
SELECT * FROM course_schedule_complaints WHERE score_ <= 2 ORDER BY id_ <include refid="global.limit"/>
|
|
SELECT * FROM course_schedule_complaints WHERE score_ <= 2 ORDER BY id_ <include refid="global.limit"/>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<!-- 查询当前表的总记录数 -->
|
|
<!-- 查询当前表的总记录数 -->
|
|
<select id="queryCount" resultType="int">
|
|
<select id="queryCount" resultType="int">
|
|
SELECT COUNT(*) FROM course_schedule_complaints
|
|
SELECT COUNT(*) FROM course_schedule_complaints
|
|
@@ -131,7 +131,15 @@
|
|
<select id="findByUserIdAndCourseId" resultMap="CourseScheduleComplaintsDtoMap">
|
|
<select id="findByUserIdAndCourseId" resultMap="CourseScheduleComplaintsDtoMap">
|
|
SELECT su.username_,csc.reason_,csc.score_,su.avatar_ FROM course_schedule_complaints csc
|
|
SELECT su.username_,csc.reason_,csc.score_,su.avatar_ FROM course_schedule_complaints csc
|
|
LEFT JOIN sys_user su on csc.user_id_ = su.id_
|
|
LEFT JOIN sys_user su on csc.user_id_ = su.id_
|
|
- WHERE user_id_=#{userId} AND course_schedule_id_=#{courseScheduleId} LIMIT 1
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="userId != null">
|
|
|
|
+ user_id_=#{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseScheduleId != null">
|
|
|
|
+ AND course_schedule_id_=#{courseScheduleId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ LIMIT 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findByCourseIdAndUserId" resultMap="CourseScheduleComplaints">
|
|
<select id="findByCourseIdAndUserId" resultMap="CourseScheduleComplaints">
|