|
@@ -21,17 +21,70 @@
|
|
|
<select id="getTrainFinishNew" resultType="com.miaxis.newgzpt.vo.TrainFinishVO" parameterType="com.miaxis.newgzpt.dto.TrainFinishDTO" >
|
|
|
select cri_id id,cri_starttime startTime, cri_endtime endTime,cri_vaild_time duration,cri_vaild_time vaildTime, cri_train_subject trainSubject, substr(cri_subjcode,0,1) as pxkmType ,c.tci_name coachName,c.tci_photo_path photoPath,c.tci_id coachId,r.cri_classid classId from tms_train_class_record@tms${dqbh} r,tms_coach_info@tms${dqbh} c
|
|
|
where r.cri_coach_id = c.tci_id(+) and r.cri_audit_result = '0'
|
|
|
- and r.cri_is_pay in (1,2) and r.cri_student_id = #{studentId}
|
|
|
- <if test="dqbh==3503">
|
|
|
- and r.cri_second_audit_result=0
|
|
|
+ and r.cri_is_pay in (1,2)
|
|
|
+ <if test="studentId!=null">
|
|
|
+ and r.cri_student_id = #{studentId}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="trainSubject!=null">
|
|
|
and r.cri_train_subject = #{trainSubject}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
+ <select id="getTrainSubjectCredit" resultType="com.miaxis.newgzpt.vo.TrainCreditVO" parameterType="com.miaxis.newgzpt.dto.TrainCreditDTO" >
|
|
|
+ select tsc_train_subject subject,
|
|
|
+ tsc_APPLY_EXAM_SUBJECT applySubject,
|
|
|
+ tsc_train_subject_name subjectName,
|
|
|
+ tsc_permit_drive_car_type carType,
|
|
|
+ tsc_credit_ration ration
|
|
|
+ from TMS_TRAIN_SUBJECT_CREDIT@tms${dqbh} c
|
|
|
+ <where>
|
|
|
+ <if test="cx!=null">
|
|
|
+ and c.TSC_PERMIT_DRIVE_CAR_TYPE = #{cx}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTrainFinishKm" resultType="com.miaxis.newgzpt.vo.TrainFinishKmVO" parameterType="com.miaxis.newgzpt.dto.TrainFinishDTO" >
|
|
|
+ select
|
|
|
+ (select sum(cri_vaild_time) from tms_train_class_record@tms${dqbh} r where r.cri_audit_result = '0' and r.cri_is_pay in (1, 2) and r.cri_train_subject = 1
|
|
|
+ <choose>
|
|
|
+ <when test="studentId!=null">
|
|
|
+ and r.cri_student_id = #{studentId}) km1,
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ) km1,
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ (select sum(cri_vaild_time) from tms_train_class_record@tms${dqbh} r where r.cri_audit_result = '0' and r.cri_is_pay in (1, 2) and r.cri_train_subject = 2
|
|
|
+ <choose>
|
|
|
+ <when test="studentId!=null">
|
|
|
+ and r.cri_student_id = #{studentId}) km2,
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ) km2,
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ (select sum(cri_vaild_time) from tms_train_class_record@tms${dqbh} r where r.cri_audit_result = '0' and r.cri_is_pay in (1, 2) and r.cri_train_subject = 3
|
|
|
+ <choose>
|
|
|
+ <when test="studentId!=null">
|
|
|
+ and r.cri_student_id = #{studentId}) km3,
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ) km3,
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ (select sum(cri_vaild_time) from tms_train_class_record@tms${dqbh} r where r.cri_audit_result = '0' and r.cri_is_pay in (1, 2) and r.cri_train_subject = 4
|
|
|
+ <choose>
|
|
|
+ <when test="studentId!=null">
|
|
|
+ and r.cri_student_id = #{studentId}) km4
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ) km4
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ from dual
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|