|  | @@ -5,7 +5,7 @@
 | 
	
		
			
				|  |  |  不要修改此文件。所有改动将在下次重新自动生成时丢失。
 | 
	
		
			
				|  |  |  -->
 | 
	
		
			
				|  |  |  <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" />
 | 
	
	
		
			
				|  | @@ -20,27 +20,27 @@
 | 
	
		
			
				|  |  |  		<result column="update_time_" property="updateTime" />
 | 
	
		
			
				|  |  |  		<result column="score_" property="score" />
 | 
	
		
			
				|  |  |  	</resultMap>
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  |  	<select id="get" resultMap="CourseScheduleComplaints" >
 | 
	
		
			
				|  |  | -		SELECT * FROM course_schedule_complaints WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +		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 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_,score_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio},#{score})
 | 
	
		
			
				|  |  |  	</insert>
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	<!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  |  	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleComplaints">
 | 
	
		
			
				|  |  |  		UPDATE course_schedule_complaints
 | 
	
	
		
			
				|  | @@ -80,10 +80,10 @@
 | 
	
		
			
				|  |  |  			</if>
 | 
	
		
			
				|  |  |  		</set> WHERE id_ = #{id}
 | 
	
		
			
				|  |  |  	</update>
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	<!-- 根据主键删除一条记录 -->
 | 
	
		
			
				|  |  |  	<delete id="delete" >
 | 
	
		
			
				|  |  | -		DELETE FROM course_schedule_complaints WHERE id_ = #{id} 
 | 
	
		
			
				|  |  | +		DELETE FROM course_schedule_complaints WHERE id_ = #{id}
 | 
	
		
			
				|  |  |  	</delete>
 | 
	
		
			
				|  |  |      <delete id="delByCourseScheduleId">
 | 
	
		
			
				|  |  |  		DELETE FROM course_schedule_complaints WHERE course_schedule_id_ = #{courseScheduleId}
 | 
	
	
		
			
				|  | @@ -99,7 +99,7 @@
 | 
	
		
			
				|  |  |  	<select id="queryPage" resultMap="CourseScheduleComplaints" parameterType="map">
 | 
	
		
			
				|  |  |  		SELECT * FROM course_schedule_complaints WHERE score_ <= 2 ORDER BY id_ <include refid="global.limit"/>
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	<!-- 查询当前表的总记录数 -->
 | 
	
		
			
				|  |  |  	<select id="queryCount" resultType="int">
 | 
	
		
			
				|  |  |  		SELECT COUNT(*) FROM course_schedule_complaints
 | 
	
	
		
			
				|  | @@ -131,7 +131,15 @@
 | 
	
		
			
				|  |  |  	<select id="findByUserIdAndCourseId" resultMap="CourseScheduleComplaintsDtoMap">
 | 
	
		
			
				|  |  |  		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_
 | 
	
		
			
				|  |  | -		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 id="findByCourseIdAndUserId" resultMap="CourseScheduleComplaints">
 |