|
@@ -1,113 +1,88 @@
|
|
|
<?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.StudentRegistrationDao">
|
|
|
|
|
|
- <resultMap type="com.ym.mec.biz.dal.entity.StudentRegistration" id="StudentRegistration">
|
|
|
- <result column="id_" property="id"/>
|
|
|
- <result column="user_id_" property="userId"/>
|
|
|
- <result column="name_" property="name"/>
|
|
|
- <result column="music_group_id_" property="musicGroupId"/>
|
|
|
- <result column="current_grade_" property="currentGrade"/>
|
|
|
- <result column="current_class_" property="currentClass"/>
|
|
|
- <result column="subject_id_" property="subjectId"/>
|
|
|
- <result column="actual_subject_id_" property="actualSubjectId"/>
|
|
|
- <result column="is_allow_adjust_" property="isAllowAdjust"
|
|
|
- typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="kit_purchase_method_" property="kitPurchaseMethod"
|
|
|
- typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="remark_" property="remark"/>
|
|
|
- <result column="class_group_id_" property="classGroupId"/>
|
|
|
- <result column="create_time_" property="createTime"/>
|
|
|
- <result column="update_time_" property="updateTime"/>
|
|
|
- <result column="parents_name_" property="parentsName"/>
|
|
|
- <result column="parents_phone_" property="parentsPhone"/>
|
|
|
- <result column="parents_company_" property="parentsCompany"/>
|
|
|
- <result column="payment_status_" property="paymentStatus"
|
|
|
- typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="last_payment_date_" property="lastPaymentDate"/>
|
|
|
- <result column="next_payment_date_" property="nextPaymentDate"/>
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.TeacherLeaveRecord" id="TeacherLeaveRecord">
|
|
|
+ <result column="id_" property="id" />
|
|
|
+ <result column="user_id_" property="userId" />
|
|
|
+ <result column="days_" property="days" />
|
|
|
+ <result column="leave_category_id_" property="leaveCategoryId" />
|
|
|
+ <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
|
|
|
+ <result column="remark_" property="remark" />
|
|
|
+ <result column="create_time_" property="createTime" />
|
|
|
+ <result column="update_time_" property="updateTime" />
|
|
|
+ <result column="start_time_" property="startTime" />
|
|
|
+ <result column="end_time_" property="endTime" />
|
|
|
+ <result column="courses_schedule_json_" property="coursesScheduleJson" />
|
|
|
+ <result column="wf_process_id_" property="wfProcessId" />
|
|
|
+ <result column="wf_order_id_" property="wfOrderId" />
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
- <select id="get" resultMap="StudentRegistration">
|
|
|
- SELECT * FROM student_registration WHERE id_ = #{id}
|
|
|
- </select>
|
|
|
+ <select id="get" resultMap="TeacherLeaveRecord">
|
|
|
+ SELECT * FROM
|
|
|
+ teacher_leave_record WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="StudentRegistration">
|
|
|
- SELECT *
|
|
|
- FROM student_registration
|
|
|
- ORDER BY id_
|
|
|
- </select>
|
|
|
-
|
|
|
+ <select id="findAll" resultMap="TeacherLeaveRecord">
|
|
|
+ SELECT * FROM
|
|
|
+ teacher_leave_record ORDER BY id_
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration" useGeneratedKeys="true"
|
|
|
- keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO student_registration
|
|
|
- (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_,actual_subject_id_)
|
|
|
- VALUES(#{parentsPhone},#{id},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherLeaveRecord"
|
|
|
+ useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
+ <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
+ AS ID FROM DUAL </selectKey> -->
|
|
|
+ INSERT INTO teacher_leave_record
|
|
|
+ (id_,user_id_,days_,leave_category_id_,status_,remark_,create_time_,update_time_,start_time_,end_time_,courses_schedule_json_,wf_process_id_,wf_order_id_)
|
|
|
+ VALUES(#{id},#{userId},#{days},#{leaveCategoryId},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{remark},#{createTime},#{updateTime},#{startTime},#{endTime},#{coursesScheduleJson},#{wfProcessId},#{wfOrderId})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
|
|
|
- UPDATE student_registration
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherLeaveRecord">
|
|
|
+ UPDATE teacher_leave_record
|
|
|
<set>
|
|
|
- <if test="parentsPhone != null">
|
|
|
- parents_phone_ = #{parentsPhone},
|
|
|
+ <if test="status != null">
|
|
|
+ status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
- <if test="subjectId != null">
|
|
|
- subject_id_ = #{subjectId},
|
|
|
+ <if test="wfOrderId != null">
|
|
|
+ wf_order_id_ = #{wfOrderId},
|
|
|
</if>
|
|
|
- <if test="nextPaymentDate != null">
|
|
|
- next_payment_date_ = #{nextPaymentDate},
|
|
|
+ <if test="id != null">
|
|
|
+ id_ = #{id},
|
|
|
</if>
|
|
|
- <if test="currentGrade != null">
|
|
|
- current_grade_ = #{currentGrade},
|
|
|
+ <if test="days != null">
|
|
|
+ days_ = #{days},
|
|
|
</if>
|
|
|
- <if test="lastPaymentDate != null">
|
|
|
- last_payment_date_ = #{lastPaymentDate},
|
|
|
+ <if test="endTime != null">
|
|
|
+ end_time_ = #{endTime},
|
|
|
</if>
|
|
|
- <if test="currentClass != null">
|
|
|
- current_class_ = #{currentClass},
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime},
|
|
|
</if>
|
|
|
- <if test="isAllowAdjust != null">
|
|
|
- is_allow_adjust_ = #{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ <if test="startTime != null">
|
|
|
+ start_time_ = #{startTime},
|
|
|
</if>
|
|
|
- <if test="kitPurchaseMethod != null">
|
|
|
- kit_purchase_method_ = #{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ <if test="coursesScheduleJson != null">
|
|
|
+ courses_schedule_json_ = #{coursesScheduleJson},
|
|
|
</if>
|
|
|
<if test="userId != null">
|
|
|
user_id_ = #{userId},
|
|
|
</if>
|
|
|
- <if test="name != null">
|
|
|
- name_ = #{name},
|
|
|
- </if>
|
|
|
<if test="remark != null">
|
|
|
remark_ = #{remark},
|
|
|
</if>
|
|
|
- <if test="paymentStatus != null">
|
|
|
- payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="parentsName != null">
|
|
|
- parents_name_ = #{parentsName},
|
|
|
+ <if test="wfProcessId != null">
|
|
|
+ wf_process_id_ = #{wfProcessId},
|
|
|
</if>
|
|
|
<if test="updateTime != null">
|
|
|
update_time_ = #{updateTime},
|
|
|
</if>
|
|
|
- <if test="parentsCompany != null">
|
|
|
- parents_company_ = #{parentsCompany},
|
|
|
- </if>
|
|
|
- <if test="musicGroupId != null">
|
|
|
- music_group_id_ = #{musicGroupId},
|
|
|
- </if>
|
|
|
- <if test="actualSubjectId != null">
|
|
|
- actual_subject_id_ = #{actualSubjectId},
|
|
|
+ <if test="leaveCategoryId != null">
|
|
|
+ leave_category_id_ = #{leaveCategoryId},
|
|
|
</if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
@@ -115,105 +90,20 @@
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete">
|
|
|
- DELETE FROM student_registration WHERE id_ = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <sql id="queryPageSql">
|
|
|
- <where>
|
|
|
- <if test="isAllowAdjust != null">
|
|
|
- AND is_allow_adjust_ = #{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="subjectId != null">
|
|
|
- AND subject_id_ = #{subjectId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
+ DELETE FROM teacher_leave_record WHERE id_ =
|
|
|
+ #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="StudentRegistration" parameterType="map">
|
|
|
- SELECT * FROM student_registration ORDER BY id_
|
|
|
- <include refid="global.limit"/>
|
|
|
+ <select id="queryPage" resultMap="TeacherLeaveRecord"
|
|
|
+ parameterType="map">
|
|
|
+ SELECT * FROM teacher_leave_record ORDER BY id_
|
|
|
+ <include refid="global.limit" />
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*)
|
|
|
- FROM student_registration
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- <sql id="queryStudentDetailPageSql">
|
|
|
- <where>
|
|
|
- <if test="musicGroupId != null">
|
|
|
- sr.music_group_id_ = #{musicGroupId}
|
|
|
- </if>
|
|
|
- <if test="subjectId != null">
|
|
|
- sr.subject_id_ = #{subjectId}
|
|
|
- </if>
|
|
|
- <if test="isAllowAdjust != null">
|
|
|
- sr.is_allow_adjust_ = #{isAllowAdjust}
|
|
|
- </if>
|
|
|
- <if test="actualSubjectId != null">
|
|
|
- sr.actual_subject_id_ = #{actualSubjectId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
-
|
|
|
- <resultMap type="com.ym.mec.biz.dal.dto.StudentApplyDetailDto" id="studentApplyDetail">
|
|
|
- <result column="current_grade_" property="currentGrade"/>
|
|
|
- <result column="current_class_" property="currentClass"/>
|
|
|
- <result column="is_allow_adjust_" property="isAllowAdjust"
|
|
|
- typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- <result column="parents_name_" property="parentsName"/>
|
|
|
- <result column="parents_phone_" property="parentsPhone"/>
|
|
|
- <result column="subject_name_" property="subjectName"/>
|
|
|
- <result column="username_" property="studentName"/>
|
|
|
- <result column="actual_subject_name_" property="actualSubjectName"/>
|
|
|
- <result column="gender_" property="gender" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
- </resultMap>
|
|
|
- <select id="queryStudentDetailPage" resultMap="studentApplyDetail">
|
|
|
- SELECT su.username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
|
|
|
- su.gender_,sr.is_allow_adjust_, s.name_ subject_name_,ss.name_ actual_subject_name_,sr.parents_phone_
|
|
|
- FROM student_registration sr
|
|
|
- LEFT JOIN sys_user su ON sr.subject_id_ = su.id_
|
|
|
- LEFT JOIN `subject` s ON sr.subject_id_ = s.id_
|
|
|
- LEFT JOIN `subject` ss ON sr.actual_subject_id_ = s.id_
|
|
|
- <include refid="queryStudentDetailPageSql"/>
|
|
|
- <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
- <select id="queryStudentDetailCount" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(sr.id_) FROM student_registration sr
|
|
|
- <include refid="queryStudentDetailPageSql"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="countPayNum" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(DISTINCT user_id_) FROM student_registration
|
|
|
- WHERE music_group_id_ = #{musicGroupId} AND subject_id_ = #{subjectId} AND payment_status_ = 1
|
|
|
- </select>
|
|
|
-
|
|
|
- <resultMap id="queryFeeDetailMap" type="com.ym.mec.biz.dal.dto.StudentFeeDto">
|
|
|
- <result column="deposit_fee_" property="depositFee"/>
|
|
|
- <result column="course_fee_" property="courseFee"/>
|
|
|
- <result column="musical_fee_" property="musicalFee"/>
|
|
|
- <result column="total_amount_" property="totalAmount"/>
|
|
|
- </resultMap>
|
|
|
- <select id="queryFeeDetail" resultMap="queryFeeDetailMap">
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 根据乐团和声部获取未分班的学生 -->
|
|
|
- <select id="getNoClassStuBySubjectId" resultMap="StudentRegistration">
|
|
|
- SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
|
|
|
- #{actualSubjectId} AND class_group_id_ >=1
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 根据乐团和声部获取未分班人数 -->
|
|
|
- <select id="getNoClassStuCountBySubjectId" resultType="java.lang.Integer">
|
|
|
- SELECT count(*) FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND actual_subject_id_ =
|
|
|
- #{actualSubjectId} AND class_group_id_ >=1
|
|
|
- </select>
|
|
|
-
|
|
|
- <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
|
|
|
- UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
|
|
|
- </update>
|
|
|
+ SELECT COUNT(*) FROM
|
|
|
+ teacher_leave_record
|
|
|
+ </select>
|
|
|
</mapper>
|