|
@@ -0,0 +1,133 @@
|
|
|
+<?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.StudentRepairDao">
|
|
|
+ <resultMap id="StudentRepair" type="com.ym.mec.biz.dal.entity.StudentRepair">
|
|
|
+ <result column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="trans_no_" jdbcType="VARCHAR" property="transNo"/>
|
|
|
+ <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
|
|
|
+ <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
|
|
|
+ <result column="student_name_" jdbcType="VARCHAR" property="studentName"/>
|
|
|
+ <result column="student_school_" jdbcType="VARCHAR" property="studentSchool"/>
|
|
|
+ <result column="employee_id_" jdbcType="INTEGER" property="employeeId"/>
|
|
|
+ <result column="employee_name_" jdbcType="VARCHAR" property="employeeName"/>
|
|
|
+ <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
|
|
|
+ <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
|
|
|
+ <result column="type_" jdbcType="INTEGER" property="type"/>
|
|
|
+ <result column="instrument_no_" jdbcType="VARCHAR" property="instrumentNo"/>
|
|
|
+ <result column="description_" jdbcType="VARCHAR" property="description"/>
|
|
|
+ <result column="amount_" jdbcType="DECIMAL" property="amount"/>
|
|
|
+ <result column="finish_time_" jdbcType="TIMESTAMP" property="finishTime"/>
|
|
|
+ <result column="send_type_" jdbcType="INTEGER" property="sendType"/>
|
|
|
+ <result column="contact_name_" jdbcType="VARCHAR" property="contactName"/>
|
|
|
+ <result column="contact_mobile_" jdbcType="VARCHAR" property="contactMobile"/>
|
|
|
+ <result column="address_" jdbcType="VARCHAR" property="address"/>
|
|
|
+ <result column="pay_status_" jdbcType="INTEGER" property="payStatus"/>
|
|
|
+ <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="StudentRepair">
|
|
|
+ SELECT *
|
|
|
+ FROM school
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into student_repair (id_, trans_no_, organ_id_,
|
|
|
+ student_id_, student_name_, student_school_,
|
|
|
+ employee_id_, employee_name_, subject_id_,
|
|
|
+ subject_name_, type_, instrument_no_,
|
|
|
+ description_, amount_, finish_time_,
|
|
|
+ send_type_, contact_name_, contact_mobile_,
|
|
|
+ address_, pay_status_, create_time_,
|
|
|
+ update_time_)
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{transNo,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER},
|
|
|
+ #{studentId,jdbcType=INTEGER}, #{studentName,jdbcType=VARCHAR}, #{studentSchool,jdbcType=VARCHAR},
|
|
|
+ #{employeeId,jdbcType=INTEGER}, #{employeeName,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
|
|
|
+ #{subjectName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{instrumentNo,jdbcType=VARCHAR},
|
|
|
+ #{description,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{finishTime,jdbcType=TIMESTAMP},
|
|
|
+ #{sendType,jdbcType=INTEGER}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
|
|
|
+ #{address,jdbcType=VARCHAR}, #{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ UPDATE student_repair
|
|
|
+ <set>
|
|
|
+ <if test="transNo != null">
|
|
|
+ trans_no_ = #{transNo},
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = ##{organId},
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ student_id_ = #{studentId},
|
|
|
+ </if>
|
|
|
+ <if test="studentName != null">
|
|
|
+ student_name_ = #{studentName},
|
|
|
+ </if>
|
|
|
+ <if test="studentSchool != null">
|
|
|
+ student_school_ = #{studentSchool},
|
|
|
+ </if>
|
|
|
+ <if test="employeeId != null">
|
|
|
+ employee_id_ = #{employeeId},
|
|
|
+ </if>
|
|
|
+ <if test="employeeName != null">
|
|
|
+ employee_name_ = #{employeeName},
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
+ </if>
|
|
|
+ <if test="subjectName != null">
|
|
|
+ subject_name_ = #{subjectName},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type_ = #{type},
|
|
|
+ </if>
|
|
|
+ <if test="instrumentNo != null">
|
|
|
+ instrument_no_ = #{instrumentNo},
|
|
|
+ </if>
|
|
|
+ <if test="description != null">
|
|
|
+ description_ = #{description},
|
|
|
+ </if>
|
|
|
+ <if test="amount != null">
|
|
|
+ amount_ = #{amount},
|
|
|
+ </if>
|
|
|
+ <if test="finishTime != null">
|
|
|
+ finish_time_ = #{finishTime},
|
|
|
+ </if>
|
|
|
+ <if test="sendType != null">
|
|
|
+ send_type_ #{sendType},
|
|
|
+ </if>
|
|
|
+ <if test="contactName != null">
|
|
|
+ contact_name_ = #{contactName},
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null">
|
|
|
+ contact_mobile_ = #{contactName},
|
|
|
+ </if>
|
|
|
+ <if test="address != null">
|
|
|
+ address_ = #{address},
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null">
|
|
|
+ pay_status_ = #{payStatus},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+ <select id="getStudents" resultType="com.ym.mec.biz.dal.dto.BasicUserDto">
|
|
|
+ SELECT username_,id_ user_id_,avatar_ head_url_,gender_
|
|
|
+ FROM sys_user
|
|
|
+ WHERE FIND_IN_SET(organ_id_,#{organIdList})
|
|
|
+ AND id_ NOT IN (
|
|
|
+ SELECT cssp.user_id_
|
|
|
+ FROM music_group mg
|
|
|
+ LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
|
|
|
+ WHERE cssp.group_type_ = 'MUSIC'
|
|
|
+ AND mg.repair_user_id_ != #{employeeId})
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+</mapper>
|