123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735 |
- <?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="sex" column="TSO_SEX" />
- <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="trainOneStatus" column="SRI_TRAIN_ONE_STATUS" />
- <result property="trainOneExamStatus" column="SRI_TRAIN_ONE_EXAM_STATUS" />
- <result property="trainOneExamTime" column="SRI_TRAIN_ONE_EXAM_TIME" />
- <result property="trainTwoStatus" column="SRI_TRAIN_TWO_STATUS" />
- <result property="trainTwoExamStatus" column="SRI_TRAIN_TWO_EXAM_STATUS" />
- <result property="trainTwoExamTime" column="SRI_TRAIN_TWO_EXAM_TIME" />
- <result property="trainThreeStatus" column="SRI_TRAIN_THREE_STATUS" />
- <result property="trainThreeExamStatus" column="SRI_TRAIN_THREE_EXAM_STATUS" />
- <result property="trainThreeExamTime" column="SRI_TRAIN_THREE_EXAM_TIME" />
- <result property="trainFourStatus" column="SRI_TRAIN_FOUR_EXAM_STATUS" />
- <result property="trainFourExamStatus" column="SRI_TRAIN_FOUR_EXAM_STATUS" />
- <result property="trainFourExamTime" column="SRI_TRAIN_FOUR_EXAM_TIME" />
- <result property="bmType" column="BM_TYPE" />
- <result property="schoolName" column="SCHOOL_NAME" />
- </resultMap>
- <resultMap id="TmsStudentInfoTempResultMap" type="com.miaxis.tms.vo.TmsStudentInfoTempVo">
- <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="bmType" column="BM_TYPE" />
- </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="password" column="TSO_PASSWORD" />
- <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="trainOneStatus" column="SRI_TRAIN_ONE_STATUS" />
- <result property="trainOneExamStatus" column="SRI_TRAIN_ONE_EXAM_STATUS" />
- <result property="trainOneExamTime" column="SRI_TRAIN_ONE_EXAM_TIME" />
- <result property="trainTwoStatus" column="SRI_TRAIN_TWO_STATUS" />
- <result property="trainTwoExamStatus" column="SRI_TRAIN_TWO_EXAM_STATUS" />
- <result property="trainTwoExamTime" column="SRI_TRAIN_TWO_EXAM_TIME" />
- <result property="trainThreeStatus" column="SRI_TRAIN_THREE_STATUS" />
- <result property="trainThreeExamStatus" column="SRI_TRAIN_THREE_EXAM_STATUS" />
- <result property="trainThreeExamTime" column="SRI_TRAIN_THREE_EXAM_TIME" />
- <result property="trainFourStatus" column="SRI_TRAIN_FOUR_STATUS" />
- <result property="trainFourExamStatus" column="SRI_TRAIN_FOUR_EXAM_STATUS" />
- <result property="trainFourExamTime" column="SRI_TRAIN_FOUR_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>
- <resultMap id="TmsSignResultMap" type="com.miaxis.tms.vo.TmsSignVo">
- <result property="trainCarLicnum" column="TDI_TRAIN_CAR_LICNUM" />
- <result property="sim" column="TDI_SIM" />
- <result property="loginTime" column="LSL_LOGIN_TIME" />
- <result property="loginFlag" column="LSL_LOGIN_FLAG" />
- </resultMap>
- <resultMap id="TmsStudentTeachLogResultMap" type="com.miaxis.tms.vo.TmsStudentTeachLogVo">
- <result property="id" column="CRI_ID" />
- <result property="recnum" column="CRI_RECNUM" />
- <result property="pxlxName" column="PXLX_NAME" />
- <result property="mile" column="MILE" />
- <result property="duration" column="CRI_DURATION" />
- <result property="vaildTime" column="CRI_VAILD_TIME" />
- <result property="trainSubject" column="CRI_TRAIN_SUBJECT" />
- <result property="startTime" column="CRI_STARTTIME" />
- <result property="endTime" column="CRI_ENDTIME" />
- <result property="coachName" column="COACH_NAME" />
- <result property="carLicnum" column="CAR_LICNUM" />
- <result property="sim" column="SIM" />
- <result property="auditResult" column="CRI_AUDIT_RESULT" />
- <result property="recordStatus" column="CRI_RECORD_STATUS" />
- <result property="classid" column="CRI_CLASSID" />
- <result property="auditReason" column="CRI_AUDIT_REASON" />
- </resultMap>
- <resultMap id="TmsPasswordResultMap" type="com.miaxis.tms.vo.TmsPasswordVo">
- <result property="name" column="TSO_NAME" />
- <result property="idcard" column="TSO_IDCARD" />
- <result property="password" column="TSO_PASSWORD" />
- </resultMap>
- <select id="getTmsMyStudentInfoList" parameterType="com.miaxis.tms.dto.TmsStudentInfoDTO" resultMap="TmsStudentInfoResultMap">
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,
- t2.SRI_TRAIN_ONE_STATUS,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time, t2.SRI_TRAIN_TWO_STATUS,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.SRI_TRAIN_Three_STATUS,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,'2' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info@tms${city} t1
- left join tms_student_train_info@tms${city} t2
- on t1.tso_id = t2.sri_student_id
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </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 schoolId!=''"> and t1.TSO_SCHOOL_ID = #{schoolId,jdbcType=NUMERIC} </if>
- <if test="state != null and state != ''"> AND t1.TSO_STATE = #{state,jdbcType=VARCHAR }</if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
- </where>
- ORDER BY t1.TSO_ID desc
- </select>
- <select id="getTmsStudentInfoList" parameterType="com.miaxis.tms.dto.TmsStudentInfoDTO" resultMap="TmsStudentInfoResultMap">
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,
- t2.SRI_TRAIN_ONE_STATUS,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time, t2.SRI_TRAIN_TWO_STATUS,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.SRI_TRAIN_Three_STATUS,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,'2' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info@tms${city} t1
- left join tms_student_train_info@tms${city} t2
- on t1.tso_id = t2.sri_student_id
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </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 schoolId !='' "> and t1.TSO_SCHOOL_ID in
- <foreach item="sid" index="index" collection="schoolId.split(',')" open="(" separator="," close=")">
- #{sid}
- </foreach>
- </if>
- <if test="state != null and state != ''"> AND t1.TSO_STATE = #{state,jdbcType=VARCHAR }</if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
- <if test="startDate!=null and startDate!='' " > and t1.tso_applydate <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-MM-dd') </if>
- <if test="endDate!=null and endDate!='' " > and t1.tso_applydate <![CDATA[ < ]]> to_date(#{endDate},'yyyy-MM-dd')+1 </if>
- </where>
- ORDER BY t1.TSO_ID desc
- </select>
- <select id="getTmsMyStudentInfoTempList" parameterType="com.miaxis.tms.dto.TmsStudentInfoTempDTO" resultMap="TmsStudentInfoTempResultMap">
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,'1' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info_temp@tms${city} t1
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </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 schoolId !='' "> and t1.TSO_SCHOOL_ID = #{schoolId,jdbcType=NUMERIC} </if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
- </where>
- ORDER BY t1.TSO_ID desc
- </select>
- <select id="getTmsStudentInfoTempList" parameterType="com.miaxis.tms.dto.TmsStudentInfoTempDTO" resultMap="TmsStudentInfoTempResultMap">
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,'1' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info_temp@tms${city} t1
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </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,jdbcType=NUMERIC} </if>-->
- <if test="schoolId != null and schoolId !='' "> and t1.TSO_SCHOOL_ID in
- <foreach item="sid" index="index" collection="schoolId.split(',')" open="(" separator="," close=")">
- #{sid}
- </foreach>
- </if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
- </where>
- ORDER BY t1.TSO_ID desc
- </select>
- <select id="getTmsAllStudentInfoList" parameterType="com.miaxis.tms.dto.TmsAllStudentInfoDTO" resultMap="TmsStudentInfoResultMap">
- select * from (
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE ,
- t1.TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,
- t2.Sri_Train_One_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,'1' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info_temp@tms${city} t1
- left join tms_student_train_info@tms${city} t2
- on t1.tso_id = t2.sri_student_id
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <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 schoolId !='' "> and t1.TSO_SCHOOL_ID in
- <foreach item="sid" index="index" collection="schoolId.split(',')" open="(" separator="," close=")">
- #{sid}
- </foreach>
- </if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
- <if test="startDate!=null and startDate!='' " > and t1.tso_applydate <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-MM-dd') </if>
- <if test="endDate!=null and endDate!='' " > and t1.tso_applydate <![CDATA[ < ]]> to_date(#{endDate},'yyyy-MM-dd')+1 </if>
- </where>
- union
- select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.
- TSO_TRAINTYPE, t1.tso_photo_path, t1.TSO_REMARK,
- t2.Sri_Train_One_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,'2' as bm_type,
- t3.tsi_shortname as school_name
- from tms_student_info@tms${city} t1
- left join tms_student_train_info@tms${city} t2
- on t1.tso_id = t2.sri_student_id
- left join tms_school_info@tms${city} t3
- on t1.tso_school_id = t3.tsi_id
- <where>
- AND t1.TSO_BUSITYPE in ('0', '1')
- AND t1.TSO_LOGOUT = 0
- <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 schoolId !='' "> and t1.TSO_SCHOOL_ID in
- <foreach item="sid" index="index" collection="schoolId.split(',')" open="(" separator="," close=")">
- #{sid}
- </foreach>
- </if>
- <if test="coachId!=null" > AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
- or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } )</if>
- <if test="startDate!=null and startDate!='' " > and t1.tso_applydate <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-MM-dd') </if>
- <if test="endDate!=null and endDate!='' " > and t1.tso_applydate <![CDATA[ < ]]> to_date(#{endDate},'yyyy-MM-dd')+1 </if>
- </where>
- )
- ORDER BY TSO_ID desc
- </select>
- <select id="getTmsStudentInfoTempById" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_id,
- 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,
- t.tso_password,
- 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
- FROM TMS_STUDENT_INFO_temp@tms${city} T
- LEFT JOIN TMS_SCHOOL_INFO@tms${city} S
- ON T.TSO_SCHOOL_ID = S.TSI_ID
- WHERE T.TSO_ID = #{id}
- </select>
- <select id="getTmsStudentInfoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_id,
- 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,
- t.tso_password,
- 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_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_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>
- <select id="getWzTmsStudentInfoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoApplyIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_id,
- 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,
- t.tso_password,
- 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_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
- nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
- nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
- nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
- nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
- (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit1@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>
- <select id="getTzTmsStudentInfoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_id,
- 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,
- t.tso_password,
- 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_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
- nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
- nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
- nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
- nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
- (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 0) || '分钟' from tms_train_subject_credit_new@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>
- <select id="getWzOldTmsStudentInfoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoApplyIdDTO" resultMap="TmsStudentInfoIdResultMap">
- SELECT t.tso_id,
- 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,
- t.tso_password,
- 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_Status,t2.Sri_Train_One_Exam_Status,t2.Sri_Train_One_Exam_Time,t2.Sri_Train_TWO_Status,t2.Sri_Train_TWO_Exam_Status,t2.Sri_Train_Two_Exam_Time,
- t2.Sri_Train_Three_Status,t2.Sri_Train_Three_Exam_Status,t2.Sri_Train_Three_Exam_Time,t2.Sri_Train_Four_Status,t2.Sri_Train_Four_Exam_Status,t2.Sri_Train_Four_Exam_Time,
- nvl(trunc(t2.sri_train_one / 60), 0) || '学时' ||nvl((mod(t2.sri_train_one, 60)), 0) || '分钟' as K1,
- nvl(trunc(t2.sri_train_two / 60), 0) || '学时' ||nvl((mod(t2.sri_train_two, 60)), 0) || '分钟' as K2,
- nvl(trunc(t2.sri_train_three / 60), 0) || '学时' ||nvl((mod(t2.sri_train_three, 60)), 0) || '分钟' as K3,
- nvl(trunc(t2.sri_train_four / 60), 0) || '学时' ||nvl((mod(t2.sri_train_four, 60)), 0) || '分钟' as K4,
- (select nvl(trunc(sum(tsc_credit_ration) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 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) / 60), 0) || '学时' ||nvl((mod(sum(tsc_credit_ration), 60)), 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>
- <select id="getTmsLogFaceListByStuId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultType="com.miaxis.tms.vo.TmsLogFaceVo" >
- select f.crdate,f.sim,f.sourceimg,f.img, f.similar, f.type from tms_log_face_info@tms${city} f
- where f.stu_out_id = #{id}
- order by f.crdate desc
- </select>
- <select id="getTmsSignListByStuId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsSignResultMap" >
- SELECT D.TDI_TRAIN_CAR_LICNUM, D.TDI_SIM, t.lsl_login_time,t.lsl_login_flag
- FROM TMS_LOG_STUDENT_LOGIN@tms${city} T
- LEFT JOIN TMS_STUDENT_INFO@tms${city} s
- ON s.TSO_ID = T.LSL_STU_ID
- LEFT JOIN TMS_DEVICE_INFO@tms${city} D
- ON D.TDI_ID = T.LSL_DEV_ID
- WHERE T.LSL_STU_ID = #{id}
- ORDER BY T.LSL_ID DESC
- </select>
- <select id="getDayStuTempCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmDayDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- select trunc(t.tso_applydate) as dateTime,count(1) as stuCount
- from tms_student_info_temp@tms${city} t
- where 1=1
- and t.tso_school_id = #{schoolId}
- and trunc(t.tso_applydate) = trunc(sysdate - #{day})
- group by trunc(t.tso_applydate)
- </select>
- <select id="getDayStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmDayDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- select trunc(t.tso_applydate) as dateTime,count(1) as stuCount
- from tms_student_info@tms${city} t
- where 1=1
- and t.tso_school_id = #{schoolId}
- and trunc(t.tso_applydate) = trunc(sysdate - #{day})
- group by trunc(t.tso_applydate)
- </select>
- <select id="getMonthStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmMonthDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- select to_char(tso_applydate, 'yyyy-MM') as dateTime,count(1) as stuCount
- from tms_student_info@tms${city} t
- where 1=1
- and t.tso_school_id = #{schoolId}
- and trunc(t.tso_applydate,'MONTH') = ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), #{month})
- group by to_char(tso_applydate, 'yyyy-MM')
- order by to_char(tso_applydate, 'yyyy-MM')
- </select>
- <select id="getYearStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmMonthDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- select to_char(tso_applydate, 'yyyy') as dateTime,count(1) as stuCount
- from tms_student_info@tms${city} t
- where 1=1
- and t.tso_school_id = #{schoolId}
- and TO_CHAR(t.tso_applydate, 'yyyy') = TO_CHAR(ADD_MONTHS(sysdate, #{month}), 'YYYY')
- group by to_char(tso_applydate, 'yyyy')
- order by to_char(tso_applydate, 'yyyy')
- </select>
- <select id="getEveryDayStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmDayListDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- select to_char(tso_applydate, 'yyyy-MM-dd') as dateTime,count(1) as stuCount
- from tms_student_info@tms${city} t
- where 1=1
- and t.tso_school_id = #{schoolId}
- and t.tso_applydate <![CDATA[ >= ]]> to_date(#{startDate},'yyyy-MM-dd')
- and t.tso_applydate <![CDATA[ < ]]> to_date(#{endDate},'yyyy-MM-dd')+1
- group by to_char(tso_applydate, 'yyyy-MM-dd')
- order by ${field} ${sort}
- </select>
- <select id="getEveryMonthStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmMonthListDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- SELECT TO_CHAR(tso_applydate, 'yyyy-MM') AS dateTime, COUNT(1) AS stuCount
- FROM tms_student_info@tms${city} t
- WHERE t.tso_school_id = #{schoolId}
- and t.tso_applydate <![CDATA[ >= ]]> to_date(#{startMonth},'yyyy-MM')
- and t.tso_applydate <![CDATA[ < ]]> to_date(#{endMonth},'yyyy-MM')+1
- GROUP BY TO_CHAR(tso_applydate, 'yyyy-MM')
- ORDER BY ${field} ${sort}
- </select>
- <select id="getEveryYearStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsBmYearListDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
- SELECT TO_CHAR(tso_applydate, 'yyyy') AS dateTime, COUNT(1) AS stuCount
- FROM tms_student_info@tms${city} t
- WHERE t.tso_school_id = #{schoolId}
- AND EXTRACT(YEAR FROM t.tso_applydate) <![CDATA[ >= ]]> #{startYear}
- AND EXTRACT(YEAR FROM t.tso_applydate) <![CDATA[ <= ]]> #{endYear}
- GROUP BY TO_CHAR(tso_applydate, 'yyyy')
- ORDER BY ${field} ${sort}
- </select>
- <update id="upStuAppCoachIdById" parameterType="com.miaxis.tms.dto.TmsStudentInfoQrDTO">
- update TMS_STUDENT_INFO@tms${city} set tso_app_coach_id = #{appCoachId} where tso_id = #{id}
- </update>
- <select id="getTmsStudentTeachLogById" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultMap="TmsStudentTeachLogResultMap" >
- SELECT CRI_RECNUM,DECODE(SUBSTR(T.CRI_SUBJCODE,0,1),1,'实操',2,'课堂教学',3,'模拟器教学',4,'远程教学','') PXLX_NAME,
- round(t.cri_mileage/1000,3) as mile,
- t.cri_duration,t.cri_vaild_time,CRI_TRAIN_SUBJECT,
- t.cri_starttime,t.cri_endtime,c.TCI_NAME COACH_NAME,
- car.tco_licnum CAR_LICNUM,t.cri_device_id sim,t.CRI_ID,t.CRI_AUDIT_RESULT,t.CRI_RECORD_STATUS,T.CRI_CLASSID,CRI_AUDIT_REASON
- FROM TMS_TRAIN_CLASS_RECORD@tms${city} T LEFT JOIN TMS_SCHOOL_INFO@tms${city} S ON T.CRI_SCHOOL_ID = S.TSI_ID
- LEFT JOIN TMS_STUDENT_INFO@tms${city} STU ON T.CRI_STUDENT_ID = STU.TSO_ID
- LEFT JOIN TMS_COACH_INFO@tms${city} C ON T.CRI_COACH_ID = C.TCI_ID
- LEFT JOIN tms_train_car_info@tms${city} car on car.tco_id=t.cri_train_car_id WHERE STU.TSO_ID = #{id}
- ORDER BY T.cri_id DESC
- </select>
- <select id="getTmsStudentPhotoById" parameterType="com.miaxis.tms.dto.TmsStudentInfoPhotoDTO" resultType="com.miaxis.tms.vo.TmsStudentPhotoVo" >
- SELECT T.EVENT,T.FILEPATH,T.PTIME FROM TMS_TRAIN_FILE_INFO@tms${city} T WHERE T.type =1
- <if test="city != '3310'">
- and is_del=0 and is_show=0
- </if>
- AND T.STU_ID = #{id}
- AND T.CLASSID = #{classId}
- ORDER BY T.ID DESC
- </select>
- <select id="getXmBmLimit" parameterType="com.miaxis.tms.dto.TmsBmDTO" resultType="com.miaxis.tms.vo.TmsBmLimitVo">
- select F_SCH_KYME_SHOW@TMS${city}(${schoolId}) KYME,
- F_SCH_JCME@TMS${city}(${schoolId}) JCME,
- F_SCH_KYZX@TMS${city}(${schoolId}) KYZX,
- decode(sign(F_SCH_KYME_SHOW@TMS${city}(${schoolId}) - F_SCH_KYZX@TMS${city}(${schoolId})),-1,
- F_SCH_KYME_SHOW@TMS${city}(${schoolId}),
- F_SCH_KYZX@TMS${city}(${schoolId})) ME
- from dual
- </select>
- <select id="getFzBmLimit" parameterType="com.miaxis.tms.dto.TmsBmDTO" resultType="com.miaxis.tms.vo.TmsFzLimitVo">
- select year, school_id, tsi_name, tsi_dqbh, tsi_dqmc,tsi_qxbh, tsi_qxmc, car_num, p_num, month_num, month, diff_num,
- (month_num + diff_num) as kbrs, ybrs,txrs,(ybrs + txrs) all_ybrs
- from (select l.year, l.school_id, s.tsi_name, s.tsi_dqbh, s.tsi_dqmc, s.tsi_qxbh, s.tsi_qxmc, l.car_num, l.p_num, l.month_num, l.month, l.diff_num,
- (l.month_num + l.diff_num) as kbrs,
- (select count(0)
- from tms_student_info@TMS${city} si
- where si.tso_school_id = l.school_id
- and si.tso_logout = '0'
- and si.tso_history = 0
- and si.tso_traintype in ('C1', 'C2')
- and l.school_id = #{schoolId }
- and to_char(si.tso_record_date, 'yyyy-MM') = to_char(sysdate,'yyyy-MM')) ybrs,
- (select count(0)
- from tms_student_logout@TMS${city} sl, tms_student_logout_temp@TMS${city} lt
- where sl.sl_school_id = l.school_id
- and sl.sl_stu_id = lt.tso_id
- and lt.tso_history = 0
- and sl.sl_traintype in ('C1', 'C2')
- and sl.sl_reason != '预报名退学'
- and to_char(sl.sl_applydate, 'yyyy-MM') = to_char(sysdate,'yyyy-MM')
- and to_char(sl.sl_crdate, 'yyyy-MM') = to_char(sysdate,'yyyy-MM') ) txrs
- from tms_school_limit@TMS${city} l, tms_school_info@TMS${city} s
- where l.school_id = s.tsi_id and s.tsi_id = #{schoolId } and year = to_char(sysdate,'yyyy') and month = to_char(sysdate,'MM'))
- </select>
- <select id="getQzBmLimit" parameterType="com.miaxis.tms.dto.TmsBmDTO" resultType="com.miaxis.tms.vo.TmsFzLimitVo">
- select l.traintype, l.year,l.crtime, l.id,l.school_id,s.tsi_name,s.tsi_dqbh,s.tsi_dqmc,s.tsi_qxbh,s.tsi_qxmc,s.tsi_bm_lock,s.tsi_bm_lock_date,l.car_num,l.p_num,l.month_num,l.month,l.sbn_num,l.xbn_num,l.diff_num,(l.month_num+l.diff_num) as kbrs,l.reason,
- (select count(0) from tms_student_info si
- where si.tso_school_id=l.school_id
- and si.tso_logout=0
- and si.tso_history=0
- and si.tso_traintype =l.traintype
- and to_char(si.tso_record_date,'yyyy-MM')= to_char(sysdate,'yyyy-MM')) ybrs
- from tms_school_limit l,tms_school_info s where l.school_id=s.tsi_id and s.tsi_id = 3505030009 and year = to_char(sysdate,'yyyy') and month = to_char(sysdate,'MM') ;
- </select>
- <select id="getPasswordByIdcard" parameterType="com.miaxis.tms.dto.TmsIdcardPhoneDTO" resultMap="TmsPasswordResultMap">
- select tso_idcard,tso_password,tso_name from TMS_STUDENT_INFO@tms${city} t
- <where>
- AND t.TSO_LOGOUT = 0
- AND t.tso_id = (SELECT MAX(tso_id) FROM tms_student_info@tms${city} t2
- <where>
- <if test="idcard != null and idcard != ''">
- and t2.tso_idcard = #{idcard,jdbcType=VARCHAR}
- </if>
- <if test="phone != null and phone != ''">
- and t2.tso_phone = #{phone,jdbcType=VARCHAR}
- </if>
- </where>
- )
- </where>
- </select>
- </mapper>
|