123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.miaxis.tms.mapper.TmsStudentInfoMapper">
- <resultMap id="TmsStudentInfoResultMap" type="com.miaxis.tms.vo.TmsStudentInfoVo">
- <id property="id" column="TSO_ID" />
- <result property="idcard" column="TSO_IDCARD" />
- <result property="name" column="TSO_NAME" />
- <result property="phone" column="TSO_PHONE" />
- <result property="applydate" column="TSO_APPLYDATE" />
- <result property="state" column="TSO_STATE" />
- <result property="trainType" column="TSO_TRAINTYPE" />
- <result property="photoPath" column="TSO_PHOTO_PATH" />
- <result property="remark" column="TSO_REMARK" />
- <result property="trainOneExamStatus" column="SRI_TRAIN_ONE_EXAM_STATUS" />
- <result property="trainOneExamTime" column="SRI_TRAIN_ONE_EXAM_TIME" />
- <result property="trainTwoExamStatus" column="SRI_TRAIN_TWO_EXAM_STATUS" />
- <result property="trainTwoExamTime" column="SRI_TRAIN_TWO_EXAM_TIME" />
- <result property="trainThreeExamStatus" column="SRI_TRAIN_THREE_EXAM_STATUS" />
- <result property="trainThreeExamTime" column="SRI_TRAIN_THREE_EXAM_TIME" />
- <result property="trainFourExamStatus" column="SRI_TRAIN_FOUR_EXAM_STATUS" />
- <result property="trainFourExamTime" column="SRI_TRAIN_FOUR_EXAM_TIME" />
- </resultMap>
- <resultMap id="TmsStudentInfoIdResultMap" type="com.miaxis.tms.vo.TmsStudentInfoIdVo">
- <id property="id" column="TSO_ID" />
- <result property="cardType" column="TSO_CARDTYPE" />
- <result property="idcard" column="TSO_IDCARD" />
- <result property="name" column="TSO_NAME" />
- <result property="sex" column="TSO_SEX" />
- <result property="phone" column="TSO_PHONE" />
- <result property="source" column="TSO_SOURCE" />
- <result property="nationality" column="TSO_NATIONALITY" />
- <result property="trainType" column="TSO_TRAINTYPE" />
- <result property="active" column="TSO_ACTIVE" />
- <result property="recordDate" column="TSO_RECORD_DATE" />
- <result property="address" column="TSO_ADDRESS" />
- <result property="photoPath" column="TSO_PHOTO_PATH" />
- <result property="face" column="FACE" />
- <result property="schoolId" column="TSI_ID" />
- <result property="schoolName" column="TSI_NAME" />
- <result property="schoolShortName" column="TSI_SHORTNAME" />
- <result property="schoolAddress" column="TSI_ADDRESS" />
- <result property="schollInscode" column="TSI_INSCODE" />
- <result property="qxbh" column="TSI_QXBH" />
- <result property="qxmc" column="TSI_QXMC" />
- <result property="dqbh" column="TSI_DQBH" />
- <result property="dqmc" column="TSI_DQMC" />
- <result property="trainOneExamStatus" column="SRI_TRAIN_ONE_EXAM_STATUS" />
- <result property="trainOneExamTime" column="SRI_TRAIN_ONE_EXAM_TIME" />
- <result property="trainTwoExamStatus" column="SRI_TRAIN_TWO_EXAM_STATUS" />
- <result property="trainTwoExamTime" column="SRI_TRAIN_TWO_EXAM_TIME" />
- <result property="k1" column="K1" />
- <result property="k2" column="K2" />
- <result property="k3" column="K3" />
- <result property="k4" column="K4" />
- <result property="totalKm1" column="TOTAL_KM1" />
- <result property="totalKm2" column="TOTAL_KM2" />
- <result property="totalKm3" column="TOTAL_KM3" />
- <result property="totalKm4" column="TOTAL_KM4" />
- <result property="k2Mileage" column="K2MILEAGE" />
- <result property="mileage" column="MILEAGE" />
- <result property="k3Mileage" column="K3MILEAGE" />
- </resultMap>
- <select id="getTmsStudentInfoList" parameterType="com.miaxis.tms.dto.TmsStudentInfoDTO" resultMap="TmsStudentInfoResultMap">
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,
- t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time
- from tms_student_info@tms${city} t1
- left join tms_student_train_info@tms${city} t2
- on t1.tso_id = t2.sri_student_id
- <where>
- AND t1.TSO_HISTORY = '0'
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId } </if>
- <if test="field != null and field != ''"> AND (t1.Tso_Name like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.TSO_IDCARD like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.Tso_Phone like '%' || #{field,jdbcType=VARCHAR} || '%') </if>
- <if test="schoolId != null "> and t1.TSO_SCHOOL_ID = #{schoolId} </if>
- <if test="state != null and state != ''"> AND t1.TSO_STATE = #{state}</if>
- </where>
- ORDER BY t1.TSO_ID desc, NLSSORT(t1.TSO_NAME, 'NLS_SORT=SCHINESE_PINYIN_M')
- </select>
- <select id="getTmsStudentInfoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_cardtype,
- t.tso_Idcard,
- t.tso_name,
- t.tso_sex,
- t.tso_phone,
- t.tso_source,
- t.TSO_NATIONALITY,
- t.tso_traintype,
- t.tso_active,
- t.tso_record_date,
- t.tso_address,
- t.tso_photo_path,
- fi.face,
- S.TSI_ID,
- S.TSI_NAME,
- S.TSI_SHORTNAME,
- S.TSI_ADDRESS,
- S.TSI_INSCODE,
- S.TSI_QXBH,
- S.TSI_QXMC,
- S.TSI_DQBH,
- S.TSI_DQMC,
- t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- nvl(trunc(t2.sri_train_one / 45), 0) || '学时' ||nvl((mod(t2.sri_train_one, 45)), 0) || '分钟' as K1,
- nvl(trunc(t2.sri_train_two / 45), 0) || '学时' ||nvl((mod(t2.sri_train_two, 45)), 0) || '分钟' as K2,
- nvl(trunc(t2.sri_train_three / 45), 0) || '学时' ||nvl((mod(t2.sri_train_three, 45)), 0) || '分钟' as K3,
- nvl(trunc(t2.sri_train_four / 45), 0) || '学时' ||nvl((mod(t2.sri_train_four, 45)), 0) || '分钟' as K4,
- (select nvl(trunc(sum(tsc_credit_ration) / 45), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 45)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 1) as total_km1,
- (select nvl(trunc(sum(tsc_credit_ration) / 45), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 45)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 2) as total_km2,
- (select nvl(trunc(sum(tsc_credit_ration) / 45), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 45)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 3) as total_km3,
- (select nvl(trunc(sum(tsc_credit_ration) / 45), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 45)), 0) || '分钟' from tms_train_subject_credit@tms${city} c where c.tsc_permit_drive_car_type = t.tso_traintype and tsc_apply_exam_subject = 4) as total_km4,
- nvl(ttv.SCTWOTOTALMILE, 0) K2MILEAGE,
- nvl(ttv.SCTOTALMILE, 0) MILEAGE,
- nvl(ttv.SCTHREETOTALMILE, 0) K3MILEAGE
- FROM TMS_STUDENT_INFO@tms${city} T
- LEFT JOIN TMS_SCHOOL_INFO@tms${city} S
- ON T.TSO_SCHOOL_ID = S.TSI_ID
- left join tms_student_train_info@tms${city} t2
- on t.tso_id = t2.sri_student_id
- left join TMS_TRAIN_TIME_VIEW@tms${city} ttv
- on ttv.studentId = tso_id
- left join tms_student_face_info@tms${city} fi
- on t.tso_id = fi.student_id
- WHERE T.TSO_ID = #{id}
- </select>
- </mapper>
|