| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733 |
- <?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.zhongzheng.modules.grade.mapper.ClassGradeUserMapper">
- <resultMap type="com.zhongzheng.modules.grade.domain.ClassGradeUser" id="ClassGradeUserResult">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="gradeId" column="grade_id"/>
- <result property="status" column="status"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="createBy" column="create_by"/>
- <result property="fromType" column="from_type"/>
- <result property="periodStatus" column="period_status"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="finishStatus" column="finish_status"/>
- <result property="officialStatus" column="official_status"/>
- <result property="learnStatus" column="learn_status"/>
- <result property="periodPlush" column="period_plush"/>
- <result property="periodTime" column="period_time"/>
- <result property="periodWaitTime" column="period_wait_time"/>
- <result property="changeGrade" column="change_grade"/>
- <result property="officialStatusMsg" column="official_status_msg"/>
- <result property="periodPlushMsg" column="period_plush_msg"/>
- <result property="officialStatusTime" column="official_status_time"/>
- <result property="periodPlushTime" column="period_plush_time"/>
- <result property="officialStatusNum" column="official_status_num"/>
- <result property="periodStatusNum" column="period_status_num"/>
- <result property="periodIngTime" column="period_ing_time"/>
- <result property="auditUserName" column="audit_user_name"/>
- <result property="toOldStatus" column="to_old_status"/>
- <result property="toOldResult" column="to_old_result"/>
- <result property="toOldTime" column="to_old_time"/>
- <result property="sevenPushCheck" column="seven_push_check"/>
- <result property="sevenPushReason" column="seven_push_reason"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserVo" id="ClassGradeUserVoResult">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="gradeId" column="grade_id"/>
- <result property="className" column="class_name"/>
- <result property="status" column="status"/>
- <result property="code" column="user_account"/>
- <result property="realName" column="realname"/>
- <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="createBy" column="create_by"/>
- <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="changeGrade" column="change_grade"/>
- <result property="interfacePushId" column="interface_push_id"/>
- <result property="classStatus" column="class_status"/>
- <result property="officialName" column="official_name"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="officialStatusNum" column="official_status_num"/>
- <result property="periodTime" column="period_time"/>
- <result property="periodWaitTime" column="period_wait_time"/>
- <result property="periodStatus" column="period_status"/>
- <result property="periodStatusNum" column="period_status_num"/>
- <result property="periodIngTime" column="period_ing_time"/>
- <result property="finishStatus" column="finish_status"/>
- <result property="learnStatus" column="learn_status"/>
- <result property="reason" column="reason"/>
- <result property="interfaceAccountId" column="interface_account_id"/>
- <result property="noInterfaceAccountId" column="no_interface_account_id"/>
- <result property="toOldStatus" column="to_old_status"/>
- <result property="toOldResult" column="to_old_result"/>
- <result property="toOldTime" column="to_old_time"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="sex" column="sex"/>
- <result property="eduLevel" column="edu_level"/>
- <result property="companyName" column="company_name"/>
- <result property="sevenPushCheck" column="seven_push_check"/>
- <result property="sevenPushReason" column="seven_push_reason"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo" id="ClassGradeUserGoodsVoResult">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="gradeId" column="grade_id"/>
- <result property="status" column="status"/>
- <result property="goodsCode" column="goods_code"/>
- <result property="goodsName" column="goods_name"/>
- <result property="gradeStatus" column="grade_status"/>
- <result property="gradeCode" column="grade_code"/>
- <result property="gradeName" column="grade_name"/>
- <result property="year" column="year"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="businessName" column="business_name"/>
- <result property="schoolName" column="school_name"/>
- <result property="createTime" column="create_time"/>
- <result property="createBy" column="create_by"/>
- <result property="goodsId" column="goods_id"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo" id="ClassPeriodStudentVo">
- <result property="userId" column="user_id"/>
- <result property="gradeId" column="grade_id"/>
- <result property="studentCode" column="user_account"/>
- <result property="realName" column="realname"/>
- <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="status" column="status"/>
- <result property="classHours" column="class_hours"/>
- <result property="periodStatus" column="period_status"/>
- <result property="secAllNum" column="sec_all_num"/>
- <result property="examNum" column="exam_num"/>
- <result property="recordNum" column="record_num"/>
- <result property="periodPlush" column="period_plush"/>
- <result property="startTime" column="start_time"/>
- <result property="endTime" column="end_time"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="rebuildNum" column="rebuild_num"/>
- <result property="profileStatus" column="profile_status"/>
- <result property="className" column="class_name"/>
- <result property="goodsName" column="goods_name"/>
- <result property="standPrice" column="stand_price"/>
- <result property="goodsCode" column="goods_code"/>
- <result property="keyValue" column="key_value"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="periodStatusNum" column="period_status_num"/>
- <result property="serviceStartTime" column="service_start_time"/>
- <result property="serviceEndTime" column="service_end_time"/>
- <result property="oneInchPhotos" column="one_inch_photos"/>
- <result property="periodTime" column="period_time"/>
- <result property="sectionName" column="section_name"/>
- <result property="companyName" column="company_name"/>
- <result property="durationTime" column="duration_time"/>
- <result property="recordStartTime" column="record_start_time"/>
- <result property="recordEndTime" column="record_end_time"/>
- <result property="onLineTime" column="on_line_time"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="sevenYear" column="seven_year"/>
- <result property="businessName" column="business_name"/>
- <result property="projectName" column="project_name"/>
- <result property="educationName" column="education_name"/>
- <result property="categoryName" column="category_name"/>
- <result property="goodsYear" column="goods_year"/>
- <result property="createTime" column="create_time"/>
- <result property="profileStatus" column="profile_status"/>
- <result property="orderSn" column="order_sn"/>
- <result property="majorId" column="major_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
- <result property="userId" column="user_id"/>
- <result property="studentCode" column="user_account"/>
- <result property="realName" column="realname"/>
- <result property="oneInchPhotos" column="one_inch_photos"/>
- <result property="idCardImg1" column="id_card_img1"/>
- <result property="idCardImg2" column="id_card_img2"/>
- <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="secAllNum" column="sec_all_num"/>
- <result property="examNum" column="exam_num"/>
- <result property="recordNum" column="record_num"/>
- <result property="pass" column="pass"/>
- <result property="cheat" column="cheat"/>
- <result property="pending" column="pending"/>
- <result property="examPass" column="exam_pass"/>
- <result property="examPending" column="exam_pending"/>
- <result property="examCheat" column="exam_cheat"/>
- <result property="keyValue" column="key_value"/>
- <result property="periodStatus" column="period_status"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="goodsName" column="goods_name"/>
- <result property="className" column="class_name"/>
- <result property="classHours" column="class_hours"/>
- <result property="orderGoodsId" column="order_goods_id"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="officialName" column="official_name"/>
- <result property="sevenYear" column="seven_year"/>
- <result property="gradeStatus" column="grade_status"/>
- <result property="sex" column="sex"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
- <result property="userId" column="user_id"/>
- <result property="id" column="id"/>
- <result property="typeName" column="type_name"/>
- <result property="realName" column="realname"/>
- <result property="classHours" column="class_hours"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="status" column="status"/>
- <result property="auditTime" column="audit_time"/>
- <result property="type" column="type"/>
- <result property="sort" column="sort"/>
- <result property="courseId" column="course_id"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="durationTime" column="duration_time"/>
- <result property="courseSort" column="course_sort"/>
- <result property="sectionType" column="section_type"/>
- <result property="realLiveStartTime" column="real_live_start_time"/>
- <result property="realLiveEndTime" column="real_live_end_time"/>
- <result property="realDuration" column="real_duration"/>
- <result property="commonSign" column="common_sign"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
- <result property="userId" column="user_id"/>
- <result property="id" column="id"/>
- <result property="courseId" column="course_id"/>
- <result property="typeName" column="type_name"/>
- <result property="realName" column="realname"/>
- <result property="classHours" column="class_hours"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="status" column="status"/>
- <result property="auditTime" column="audit_time"/>
- <result property="type" column="type"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="performance" column="performance"/>
- <result property="sort" column="sort"/>
- <result property="doType" column="do_type"/>
- <result property="moduleId" column="module_id"/>
- <result property="commonSign" column="common_sign"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
- <result property="userId" column="user_id"/>
- <result property="id" column="id"/>
- <result property="typeName" column="type_name"/>
- <result property="realName" column="realname"/>
- <result property="classHours" column="class_hours"/>
- <result property="durationTime" column="duration_time"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="status" column="status"/>
- <result property="auditTime" column="audit_time"/>
- <result property="type" column="type"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="auditNum" column="audit_num"/>
- <result property="sort" column="sort"/>
- <result property="sectionType" column="section_type"/>
- <result property="realLiveStartTime" column="real_live_start_time"/>
- <result property="realLiveEndTime" column="real_live_end_time"/>
- <result property="realDuration" column="real_duration"/>
- <result property="recordingUrl" column="recording_url"/>
- <result property="doType" column="do_type"/>
- <result property="chapterId" column="chapter_id"/>
- <result property="moduleId" column="module_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterVo" id="CourseChapterResultVo">
- <result property="chapterId" column="chapter_id"/>
- <result property="name" column="name"/>
- <result property="commonSign" column="common_sign"/>
- <result property="sectionNum" column="section_num"/>
- </resultMap>
- <select id="selectUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassGradeUserVoResult">
- SELECT
- g.*,
- u.user_account,
- u.realname,
- u.id_card,
- u.telphone,
- u.sex,
- u.edu_level,
- u.company_name,
- cg.class_name,
- cg.official_name,
- cg.class_status,
- cg.interface_push_id,
- cg.class_start_time,
- cg.class_end_time,
- g.official_status_num,
- g.period_time,
- g.period_wait_time,
- g.period_status
- FROM
- class_grade_user g
- LEFT JOIN `user` u ON g.user_id = u.user_id
- LEFT JOIN class_grade cg ON cg.grade_id = g.grade_id
- WHERE
- 1 = 1
- AND g.change_grade = 0
- AND g.grade_id = #{gradeId}
- AND g.user_id = #{userId}
- AND g.order_goods_id = #{orderGoodsId}
- </select>
- <select id="select" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassGradeUserVoResult">
- SELECT
- g.*,
- u.user_account,
- u.realname,
- u.id_card,
- u.telphone
- FROM
- class_grade_user g
- LEFT JOIN `user` u ON g.user_id = u.user_id
- WHERE
- 1 = 1
- <if test="status != null and status.size()!=0 ">
- AND g.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="gradeId != null and gradeId != ''">
- AND g.grade_id = #{gradeId}
- </if>
- <if test="userId != null and userId != ''">
- AND g.user_id = #{userId}
- </if>
- <if test="classStartTime != null or classEndTime != null ">
- AND #{classStartTime} BETWEEN g.class_start_time
- </if>
- order by g.update_time desc
- </select>
- <select id="listUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- * ,
- g.code as goods_code,
- g.`year`,
- g.goods_name,
- (select b.business_name FROM course_business b where b.id = g.business_id) as business_name,
- (select b.project_name FROM course_project_type b where b.id = g.project_id) as project_name,
- (select b.school_name FROM school b where b.id = g.school_id) as school_name,
- (select b.education_name FROM course_education_type b where b.id = g.education_type_id) as education_name,
- (SELECT g.grade_code FROM class_grade g where u.grade_id = g.grade_id) as grade_code,
- (SELECT g.class_name FROM class_grade g where u.grade_id = g.grade_id) as grade_name,
- (SELECT g.status FROM class_grade g where u.grade_id = g.grade_id) as grade_status
- FROM
- class_grade_user u
- LEFT JOIN order_goods og on og.order_goods_id = u.order_goods_id
- LEFT JOIN goods g on g.goods_id = og.goods_id
- where 1=1
- <if test="status != null and status.size()!=0 ">
- AND u.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="userId != null and userId != ''">
- and u.user_id= #{userId}
- </if>
- order by u.create_time desc
- </select>
- <select id="listUserNoTenant" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- * ,
- g.code as goods_code,
- g.`year`,
- g.goods_name,
- (select b.business_name FROM course_business b where b.id = g.business_id) as business_name,
- (select b.project_name FROM course_project_type b where b.id = g.project_id) as project_name,
- (select b.school_name FROM school b where b.id = g.school_id) as school_name,
- (select b.education_name FROM course_education_type b where b.id = g.education_type_id) as education_name,
- (SELECT g.grade_code FROM class_grade g where u.grade_id = g.grade_id) as grade_code,
- (SELECT g.class_name FROM class_grade g where u.grade_id = g.grade_id) as grade_name,
- (SELECT g.status FROM class_grade g where u.grade_id = g.grade_id) as grade_status
- FROM
- class_grade_user u
- LEFT JOIN order_goods og on og.order_goods_id = u.order_goods_id
- LEFT JOIN goods g on g.goods_id = og.goods_id
- where 1=1
- <if test="status != null and status.size()!=0 ">
- AND u.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="userId != null and userId != ''">
- and u.user_id= #{userId}
- </if>
- order by u.create_time desc
- </select>
- <select id="listUserVideoRecord" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- up.* ,cg.class_name,cs.duration_time,u.id_card,u.realname,u.one_inch_photos,u.company_name,cs.`name` as section_name,ups.record_start_time,ups.record_end_time,ups.update_time as on_line_time
- FROM
- user_period up
- LEFT JOIN user_period_status ups ON up.id = ups.period_id
- LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
- LEFT JOIN goods g ON up.goods_id = g.goods_id
- LEFT JOIN course_section cs ON up.section_id = cs.section_id
- LEFT JOIN `user` u ON up.user_id = u.user_id
- WHERE
- up.grade_id > 0 and up.type = 1
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="projectId != null and projectId != ''">
- AND g.project_id = #{projectId}
- </if>
- <if test="realname != null and realname != ''">
- AND u.realname like concat('%', #{realname}, '%')
- </if>
- <if test="telphone != null and telphone != ''">
- AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
- </if>
- <if test="idCard != null and idCard != ''">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="companyName != null and companyName != ''">
- AND u.company_name like concat('%', #{companyName}, '%')
- </if>
- order by up.create_time desc
- </select>
- <select id="listUserVideoRecordNew" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- up.* ,cg.class_name,cs.duration_time,u.id_card,u.realname,u.one_inch_photos,u.company_name,cs.`name` as section_name,ups.record_start_time,ups.record_end_time,ups.update_time as on_line_time
- FROM
- user_period up
- LEFT JOIN user_period_status ups ON up.id = ups.period_id
- LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
- LEFT JOIN goods g ON up.goods_id = g.goods_id
- LEFT JOIN course_section cs ON up.section_id = cs.section_id
- LEFT JOIN `user` u ON up.user_id = u.user_id
- WHERE
- up.grade_id > 0 and up.type = 1
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectIds != null and projectIds.size()!=0 ">
- AND g.project_id in
- <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
- AND g.education_type_id in
- <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="realname != null and realname != ''">
- AND u.realname like concat('%', #{realname}, '%')
- </if>
- <if test="telphone != null and telphone != ''">
- AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
- </if>
- <if test="idCard != null and idCard != ''">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="companyName != null and companyName != ''">
- AND u.company_name like concat('%', #{companyName}, '%')
- </if>
- <if test="tenantIds != null and tenantIds.size()!=0 ">
- AND up.tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- order by up.create_time desc
- </select>
- <select id="listUserVideoRecordNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultType="java.lang.Long">
- SELECT
- count(up.id)
- FROM
- user_period up
- LEFT JOIN user_period_status ups ON up.id = ups.period_id
- LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
- LEFT JOIN goods g ON up.goods_id = g.goods_id
- LEFT JOIN course_section cs ON up.section_id = cs.section_id
- LEFT JOIN `user` u ON up.user_id = u.user_id
- WHERE
- up.grade_id > 0 and up.type = 1
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectIds != null and projectIds.size()!=0 ">
- AND g.project_id in
- <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
- AND g.education_type_id in
- <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="realname != null and realname != ''">
- AND u.realname like concat('%', #{realname}, '%')
- </if>
- <if test="telphone != null and telphone != ''">
- AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
- </if>
- <if test="idCard != null and idCard != ''">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="companyName != null and companyName != ''">
- AND u.company_name like concat('%', #{companyName}, '%')
- </if>
- <if test="tenantIds != null and tenantIds.size()!=0 ">
- AND up.tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- order by up.create_time desc
- </select>
- <select id="listUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- u.user_account,
- u.user_id,
- cgu.`status`,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- u.one_inch_photos,
- u.company_name,
- up.`status` as profile_status,
- g.class_hours as class_hours,
- g.study_start_time as study_start_time,
- g.study_end_time as study_end_time,
- g.goods_name,
- g.code as goods_code,
- g.stand_price,
- cgu.period_status,
- cg.class_start_time,
- cg.class_end_time,
- cg.class_name,
- cgu.period_plush,
- cgu.period_status_num,
- cgu.period_time,
- cgu.order_goods_id,
- og.order_sn,
- g.major_id,
- /* IFNULL(ge.exam_num,0) as exam_num, */
- <if test="userPhoto != null and userPhoto == 1">
- up.key_value,
- </if>
- cgu.period_wait_time as end_time,
- (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year,
- (SELECT og.service_start_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
- (SELECT og.service_end_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
- <if test="userPhoto == null">
- /* ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = og.goods_id and up.grade_id = cgu.grade_id and up.order_goods_id = cgu.order_goods_id and up.user_id = u.user_id
- and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num */
- </if>
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- /* LEFT JOIN (SELECT
- COUNT( m.id ) AS exam_num,
- c.goods_id
- FROM
- course_menu_exam m
- LEFT JOIN goods_course c ON m.course_id = c.course_id
- where
- m.type in (1,3)
- GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id */
- where 1=1
- and cgu.`status` =1
- and cb.`period_check_sign` = 1
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectId != null and projectId != ''">
- AND g.project_id = #{projectId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="className != null and className !='' ">
- and cg.class_name like concat('%', #{className}, '%')
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (u.realname like concat('%', #{searchKey}, '%')
- or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
- or g.goods_name like concat('%', #{searchKey}, '%')
- or cg.class_name like concat('%', #{searchKey}, '%')
- or u.company_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="inputOrderSn != null and inputOrderSn != '' ">
- and (select count(*) from `order` o where o.order_sn =og.order_sn and o.input_order_sn = #{inputOrderSn})>0
- </if>
- <if test="companyName != null and companyName != '' ">
- and u.company_name like concat('%', #{companyName}, '%')
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="telphone != null and telphone !='' ">
- AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="searchStartTime != null and searchStartTime !='' ">
- AND cgu.create_time >=#{searchStartTime}
- </if>
- <if test="searchEndTime != null and searchEndTime !='' ">
- AND #{searchEndTime} >= cgu.create_time
- </if>
- <if test="periodStartTime != null and periodStartTime !='' ">
- AND cgu.period_time >=#{periodStartTime}
- </if>
- <if test="periodEndTime != null and periodEndTime !='' ">
- AND #{periodEndTime} >= cgu.period_time
- </if>
- <if test="periodStatus != 2 and periodStatus != 3 and ascSort == 0">
- order by cgu.update_time desc
- </if>
- <if test="periodStatus == 2 and ascSort == 0">
- order by cgu.period_wait_time,cgu.create_time
- </if>
- <if test="periodStatus == 3 and ascSort == 0">
- order by cgu.period_ing_time,cgu.create_time
- </if>
- <if test="ascSort == 1 ">
- order by cgu.update_time desc
- </if>
- </select>
- <select id="listUserPeriodNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultType="java.lang.Long">
- SELECT
- count(cgu.id)
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- where 1=1
- and cgu.`status` =1
- and cb.`period_check_sign` = 1
- <if test="projectIds != null and projectIds.size()!=0 ">
- AND g.project_id in
- <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
- AND g.education_type_id in
- <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and u.realname like concat('%', #{searchKey}, '%')
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="tenantIds != null and tenantIds.size()!=0 ">
- AND cgu.tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- order by cgu.update_time desc
- </select>
- <select id="listUserPeriodNew" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultType="com.zhongzheng.modules.grade.vo.ClassPeriodStudentNewVo">
- SELECT
- u.user_id,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- up.`status` as profile_status,
- g.goods_name,
- cg.class_name,
- cgu.order_goods_id,
- (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year,
- cgu.period_wait_time as end_time,
- cgu.tenant_id,
- CONCAT(cet.education_name,cpt.project_name,cb.business_name) AS fullName
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- where 1=1
- and cgu.`status` =1
- and cb.`period_check_sign` = 1
- <if test="projectIds != null and projectIds.size()!=0 ">
- AND g.project_id in
- <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
- AND g.education_type_id in
- <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and u.realname like concat('%', #{searchKey}, '%')
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="tenantIds != null and tenantIds.size()!=0 ">
- AND cgu.tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- order by cgu.update_time desc
- </select>
- <select id="getEduIdByTenant" parameterType="map" resultType="java.lang.Long">
- SELECT id FROM course_education_type WHERE tenant_id = #{tenantId} AND education_name = #{eduName} AND `status` = 1 LIMIT 1
- </select>
- <select id="getProIdByTenant" parameterType="map" resultType="java.lang.Long">
- SELECT id FROM course_project_type WHERE tenant_id = #{tenantId} AND project_name = #{proName} AND education_id = #{eduId} AND `status` = 1 LIMIT 1
- </select>
- <select id="exportUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- u.user_account,
- u.user_id,
- cgu.`status`,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- u.one_inch_photos,
- u.company_name,
- up.`status` as profile_status,
- g.class_hours as class_hours,
- g.study_start_time as study_start_time,
- g.study_end_time as study_end_time,
- g.goods_name,
- g.code as goods_code,
- g.stand_price,
- cgu.period_status,
- cg.class_start_time,
- cg.class_end_time,
- cg.class_name,
- cgu.period_plush,
- cgu.period_status_num,
- cgu.period_time,
- cgu.order_goods_id,
- og.order_sn,
- g.major_id,
- IFNULL(ge.exam_num,0) as exam_num,
- <if test="userPhoto != null and userPhoto == 1">
- up.key_value,
- </if>
- cgu.period_wait_time as end_time,
- (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year,
- (SELECT og.service_start_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
- (SELECT og.service_end_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
- <if test="userPhoto == null">
- /* ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = og.goods_id and up.grade_id = cgu.grade_id and up.order_goods_id = cgu.order_goods_id and up.user_id = u.user_id
- and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num */
- </if>
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- LEFT JOIN (SELECT
- COUNT( m.id ) AS exam_num,
- c.goods_id
- FROM
- course_menu_exam m
- LEFT JOIN goods_course c ON m.course_id = c.course_id
- where
- m.type in (1,3)
- GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
- where 1=1
- and cgu.`status` =1
- and cb.`period_check_sign` = 1
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectId != null and projectId != ''">
- AND g.project_id = #{projectId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="className != null and className !='' ">
- and cg.class_name like concat('%', #{className}, '%')
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (u.realname like concat('%', #{searchKey}, '%')
- or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
- or g.goods_name like concat('%', #{searchKey}, '%')
- or cg.class_name like concat('%', #{searchKey}, '%')
- or u.company_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="inputOrderSn != null and inputOrderSn != '' ">
- and (select count(*) from `order` o where o.order_sn =og.order_sn and o.input_order_sn = #{inputOrderSn})>0
- </if>
- <if test="companyName != null and companyName != '' ">
- and u.company_name like concat('%', #{companyName}, '%')
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="telphone != null and telphone !='' ">
- AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="searchStartTime != null and searchStartTime !='' ">
- AND cgu.create_time >=#{searchStartTime}
- </if>
- <if test="searchEndTime != null and searchEndTime !='' ">
- AND #{searchEndTime} >= cgu.create_time
- </if>
- <if test="periodStartTime != null and periodStartTime !='' ">
- AND cgu.period_time >=#{periodStartTime}
- </if>
- <if test="periodEndTime != null and periodEndTime !='' ">
- AND #{periodEndTime} >= cgu.period_time
- </if>
- <if test="periodStatus != 2 and periodStatus != 3">
- order by cgu.update_time desc
- </if>
- <if test="periodStatus == 2 ">
- order by cgu.period_wait_time,cgu.create_time
- </if>
- <if test="periodStatus == 3 ">
- order by cgu.period_ing_time,cgu.create_time
- </if>
- </select>
- <select id="listUserPeriodTotal" parameterType="java.lang.Integer" resultType="java.lang.Long">
- SELECT
- COUNT( cgu.id )
- FROM
- class_grade_user cgu
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON og.goods_id = g.goods_id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- WHERE
- cgu.`status` = 1
- AND cb.period_check_sign = 1
- AND cgu.period_status = #{periodStatus}
- </select>
- <select id="exportNoPassRecord" resultType="com.zhongzheng.modules.grade.vo.ClassNoPassExportVo">
- SELECT
- u.realname AS realName,
- AES_DECRYPT( UNHEX( u.id_card ), 'base20230213zzkj' ) AS idCard,
- AES_DECRYPT( UNHEX( u.telphone ), 'base20230213zzkj' ) AS telPhone,
- u.company_name AS companyName,
- m.category_name AS categoryName,
- g.goods_name AS goodsName,
- (SELECT FROM_UNIXTIME( ups.audit_time, '%Y-%m-%d %H:%i:%s' ) FROM user_period up
- LEFT JOIN user_period_status ups ON up.id = ups.period_id WHERE up.order_goods_id = cgu.order_goods_id LIMIT 1 ) AS noPassTime,
- '否' AS restart,
- '' AS restartTime
- FROM
- class_grade_user cgu
- LEFT JOIN `user` u ON cgu.user_id = u.user_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON og.goods_id = g.goods_id
- LEFT JOIN major m ON g.major_id = m.id
- WHERE
- cgu.`status` = 1
- AND cgu.period_status = 0
- </select>
- <select id="exportRestartRecord" resultType="com.zhongzheng.modules.grade.vo.ClassNoPassExportVo">
- SELECT
- u.realname AS realName,
- AES_DECRYPT( UNHEX( u.id_card ), 'base20230213zzkj' ) AS idCard,
- AES_DECRYPT( UNHEX( u.telphone ), 'base20230213zzkj' ) AS telPhone,
- u.company_name AS companyName,
- m.category_name AS categoryName,
- g.goods_name AS goodsName,
- (SELECT FROM_UNIXTIME( ups.audit_time, '%Y-%m-%d %H:%i:%s' ) FROM user_period up
- LEFT JOIN user_period_status ups ON up.id = ups.period_id WHERE up.order_goods_id = cgu.order_goods_id LIMIT 1 ) AS noPassTime,
- '是' AS restart,
- (SELECT FROM_UNIXTIME( ups.record_start_time , '%Y-%m-%d %H:%i:%s' ) FROM user_period up LEFT JOIN user_period_status ups ON up.id = ups.period_id WHERE up.order_goods_id = cgu.order_goods_id AND ups.`status` = 2
- AND ups.record_start_time IS NOT NULL ORDER BY ups.record_start_time LIMIT 1) AS restartTime
- FROM
- class_grade_user cgu
- LEFT JOIN `user` u ON cgu.user_id = u.user_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON og.goods_id = g.goods_id
- LEFT JOIN major m ON g.major_id = m.id
- WHERE
- cgu.`status` = 1
- AND cgu.period_status = -1
- AND (SELECT COUNT(*) FROM user_period up LEFT JOIN user_period_status ups ON up.id = ups.period_id WHERE up.order_goods_id = cgu.order_goods_id AND ups.`status` = 3 ) > 0
- </select>
- <select id="listUserWeekStudyTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultType="Long">
- SELECT
- IFNULL( SUM( cs.duration_time ), 0 )
- FROM
- (
- SELECT
- section_id
- FROM
- user_study_record
- WHERE
- user_id = #{userId}
- AND grade_id = #{gradeId}
- AND order_goods_id = #{orderGoodsId}
- AND current_status = 1
- AND `status` = 1
- <if test="searchWeekStartTime != null and searchWeekStartTime != '' ">
- AND update_time >= #{searchWeekStartTime}
- </if>
- <if test="searchWeekEndTime != null and searchWeekEndTime != '' ">
- AND #{searchWeekEndTime} >= update_time
- </if>
- GROUP BY
- course_id,
- module_id,
- chapter_id,
- section_id
- ) usr
- LEFT JOIN course_section cs ON usr.section_id = cs.section_id
- </select>
- <select id="listUserWeekPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- u.user_account,
- u.user_id,
- cgu.`status`,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- u.one_inch_photos,
- up.`status` as profile_status,
- g.class_hours as class_hours,
- g.study_start_time as study_start_time,
- g.study_end_time as study_end_time,
- g.goods_name,
- g.code as goods_code,
- g.stand_price,
- cgu.period_status,
- cg.class_start_time,
- cg.class_end_time,
- cg.class_name,
- cgu.period_plush,
- cgu.period_status_num,
- cgu.period_time,
- cgu.order_goods_id,
- <if test="userPhoto != null and userPhoto == 1">
- up.key_value,
- </if>
- cgu.period_wait_time as end_time
- <if test="userPhoto == null">
- ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = og.goods_id and up.grade_id = cgu.grade_id and up.user_id = u.user_id
- and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num
- </if>
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- where 1=1
- and cgu.`status` =1
- <if test="searchWeekStartTime != null and searchWeekEndTime != '' ">
- AND (SELECT count(*) from user_study_record usr where usr.user_id = cgu.user_id AND usr.grade_id = cgu.grade_id AND usr.current_status = 1 AND #{searchWeekEndTime} >= usr.update_time AND usr.update_time >=#{searchWeekStartTime}) >0
- </if>
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="className != null and className !='' ">
- and cg.class_name like concat('%', #{className}, '%')
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (u.realname like concat('%', #{searchKey}, '%') or g.goods_name like concat('%', #{searchKey}, '%') or cg.class_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="telphone != null and telphone !='' ">
- AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="searchStartTime != null and searchStartTime !='' ">
- AND cgu.create_time >=#{searchStartTime}
- </if>
- <if test="searchEndTime != null and searchEndTime !='' ">
- AND #{searchEndTime} >= cgu.create_time
- </if>
- <if test="periodStartTime != null and periodStartTime !='' ">
- AND cgu.period_time >=#{periodStartTime}
- </if>
- <if test="periodEndTime != null and periodEndTime !='' ">
- AND #{periodEndTime} >= cgu.period_time
- </if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- <if test="periodStatus != 2 and periodStatus != 3">
- order by cgu.update_time desc
- </if>
- <if test="periodStatus == 2 ">
- order by cgu.period_wait_time,cgu.create_time
- </if>
- <if test="periodStatus == 3 ">
- order by cgu.period_ing_time,cgu.create_time
- </if>
- </select>
- <select id="listUserPeriodExport" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- u.user_account,
- u.user_id,
- cgu.`status`,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- g.class_hours as class_hours,
- g.study_start_time as study_start_time,
- g.study_end_time as study_end_time,
- g.goods_name,
- g.code as goods_code,
- g.stand_price,
- cgu.period_status,
- cg.class_start_time,
- cg.class_end_time,
- cg.class_name,
- cgu.period_plush,
- cgu.period_status_num,
- cgu.order_goods_id,
- (SELECT og.service_start_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
- (SELECT og.service_end_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
- <if test="userPhoto != null and userPhoto == 1">
- up.key_value,
- </if>
- cgu.period_time as end_time
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = g.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- where 1=1
- <if test="searchWeekStartTime != null and searchWeekEndTime != '' ">
- AND (SELECT count(*) from user_study_record usr where usr.user_id = cgu.user_id AND usr.grade_id = cgu.grade_id AND usr.current_status = 1 AND #{searchWeekEndTime} >= usr.update_time AND usr.update_time >=#{searchWeekStartTime}) >0
- </if>
- and cgu.`status` =1
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (
- u.realname like concat('%', #{searchKey}, '%')
- or u.id_card like concat('%', #{searchKey}, '%')
- or g.goods_name like concat('%', #{searchKey}, '%')
- or cg.class_name like concat('%', #{searchKey}, '%')
- or u.company_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="searchStartTime != null and searchStartTime !='' ">
- AND cgu.create_time >=#{searchStartTime}
- </if>
- <if test="searchEndTime != null and searchEndTime !='' ">
- AND #{searchEndTime} >= cgu.create_time
- </if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- <if test="periodStatus != 2 and periodStatus != 3">
- order by cgu.update_time desc
- </if>
- <if test="periodStatus == 2 ">
- order by cgu.period_wait_time,cgu.create_time
- </if>
- <if test="periodStatus == 3 ">
- order by cgu.period_ing_time,cgu.create_time
- </if>
- </select>
- <select id="userPeriodStatus" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- IFNULL(ge.exam_num,0) as exam_num,
- cg.class_start_time,
- cg.class_end_time,
- g.study_start_time,
- g.study_end_time,
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.report_status=1 and ubr.`type` in (1,3) and ubr.grade_id = cg.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
- cgu.user_id,
- og.goods_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og on og.order_goods_id=cgu.order_goods_id
- LEFT JOIN goods g on g.goods_id=og.goods_id
- LEFT JOIN (SELECT
- COUNT( m.id ) AS exam_num,
- c.goods_id
- FROM
- course_menu_exam m
- LEFT JOIN goods_course c ON m.course_id = c.course_id
- where
- m.type in (1,3)
- GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
- where 1=1
- and cgu.`status` =1
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="userId != null ">
- and cgu.user_id = #{userId}
- </if>
- <if test="orderGoodsId != null ">
- and cgu.order_goods_id = #{orderGoodsId}
- </if>
- LIMIT 1
- </select>
- <select id="listPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodUserVo">
- SELECT
- u.user_account,
- u.realname,
- u.id_card,
- u.user_id,
- u.telphone,
- u.sex,
- g.goods_id,
- g.goods_name,
- cg.class_name,
- cg.official_name,
- cg.class_start_time,
- cg.class_end_time,
- cg.official_name,
- cg.status as grade_status,
- g.class_hours,
- u.one_inch_photos,
- u.id_card_img1,
- u.id_card_img2,
- cgu.period_status,
- cgu.order_goods_id,
- (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN
- order_goods og on og.goods_id = c.goods_id where og.order_goods_id=cgu.order_goods_id and m.type in (1,3) ) as exam_num,
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id, ubr.exam_id) FROM user_bank_record ubr where ubr.`status` = 1 and ubr.`type` in (1,3) and ubr.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.order_goods_id=cgu.order_goods_id and ubr.current_status=1) as record_num,
- (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
- ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.`type` = 1) as pass,
- (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
- ups.`status` =2 and up.grade_id = cg.grade_id and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type` = 1) as pending,
- (SELECT
- COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
- =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type` = 1) as cheat,
- (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
- ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.grade_id = cg.grade_id and up.`type` in (2,3)) as exam_pass,
- (SELECT
- COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
- =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type` in (2,3)) as exam_cheat,
- (SELECT
- COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
- =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type` in (2,3)) as exam_pending,
- (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value,
- (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year
- <if test="userId != null and userId !='' ">
- ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_start_time,
- (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_end_time
- </if>
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON g.goods_id = og.goods_id
- where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="periodStatus != null and periodStatus !='' ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- and cgu.order_goods_id = #{orderGoodsId}
- </if>
- LIMIT 1
- </select>
- <select id="listPeriodAudit" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodVo">
- SELECT
- gc.sort as course_sort,
- cm.sort,
- cm.menu_id as id,
- cm.course_id,
- (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>) as realname,
- (SELECT u.user_id FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>) as user_id,
- (SELECT cm.module_name FROM course_module cm where cm.menu_id = cm.module_id) as type_name,
- 0 as common_sign,
- (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs LEFT JOIN course_module_chapter cmc on
- cmc.chapter_id=ccs.chapter_id where cmc.module_id=cm.menu_id) as class_hours,
- 1 as type,
- NULL as study_start_time,
- NULL as study_end_time
- FROM
- course_menu cm
- LEFT JOIN goods_course gc on gc.course_id = cm.course_id
- where 1=1
- <if test="goodsId != null and goodsId !='' ">
- and gc.goods_id=#{goodsId}
- </if>
- <if test="courseId != null and courseId !='' ">
- and gc.course_id=#{courseId}
- </if>
- AND cm.type=1
- UNION
- SELECT
- gc.sort as course_sort,
- cm.sort,
- cm.menu_id as id,
- cm.course_id,
- (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>) as realname,
- (SELECT u.user_id FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>) as user_id,
- (SELECT cc.`name` FROM course_chapter cc where cm.menu_id = cc.chapter_id) as type_name,
- (SELECT cc.common_sign FROM course_chapter cc where cm.menu_id = cc.chapter_id) as common_sign,
- (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs where ccs.chapter_id=cm.menu_id) as class_hours,
- 2 as type,
- (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
- ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time ASC
- limit 1) as study_start_time,
- (SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
- ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time DESC
- limit 1) as study_end_time
- FROM
- course_menu cm
- LEFT JOIN goods_course gc on gc.course_id = cm.course_id
- where 1=1
- <if test="goodsId != null and goodsId !='' ">
- and gc.goods_id=#{goodsId}
- </if>
- <if test="courseId != null and courseId !='' ">
- and gc.course_id=#{courseId}
- </if>
- AND cm.type=2
- </select>
- <select id="listPeriodAuditSection" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodVo">
- SELECT
- gc.sort as course_sort,
- cm.sort,
- cm.menu_id as id,
- cm.course_id,
- (SELECT u.realname FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as realname,
- (SELECT u.user_id FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as user_id,
- cs.`name` as type_name,
- cs.duration_time,
- cs.real_live_start_time,
- cs.real_live_end_time,
- cs.real_duration,
- cs.section_type,
- null as class_hours,
- 3 as type
- FROM
- course_menu cm
- LEFT JOIN course_section cs on cm.menu_id = cs.section_id
- LEFT JOIN goods_course gc on gc.course_id = cm.course_id
- where 1=1
- <if test="goodsId != null and goodsId !='' ">
- and gc.goods_id = #{goodsId}
- </if>
- <if test="courseId != null ">
- and gc.course_id=#{courseId}
- </if>
- AND cm.type=3
- </select>
- <select id="listPeriodAuditExam" parameterType="map" resultMap="ClassPeriodChapterVo">
- SELECT
- cme.exam_id as id,
- cme.course_id,
- (SELECT u.realname FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as realname,
- (SELECT u.user_id FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as user_id,
- (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
- null as class_hours,
- 4 as type,
- (
- SELECT
- ups.record_start_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- period_status = 1
- AND up.course_id = gc.course_id
- <if test="goodsId != null and goodsId !='' ">
- AND up.goods_id = #{goodsId}
- </if>
- and cme.section_id =up.section_id
- AND up.exam_id = cme.exam_id
- ) AS study_start_time,
- (
- SELECT
- ups.record_end_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- period_status = 1
- AND up.course_id = gc.course_id
- <if test="goodsId != null and goodsId !='' ">
- AND up.goods_id = #{goodsId}
- </if>
- AND up.exam_id = cme.exam_id
- ) AS study_end_time,
- (
- SELECT
- ups.`status`
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- period_status = 1
- AND up.course_id = gc.course_id
- <if test="goodsId != null and goodsId !='' ">
- AND up.goods_id = #{goodsId}
- </if>
- and cme.section_id =up.section_id
- AND up.exam_id = cme.exam_id
- ) AS STATUS,
- (
- SELECT
- ups.create_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- period_status = 1
- AND up.course_id = gc.course_id
- <if test="goodsId != null and goodsId !='' ">
- AND up.goods_id = #{goodsId}
- </if>
- and cme.section_id =up.section_id
- AND up.exam_id = cme.exam_id
- ) AS audit_time,
- (
- SELECT
- COUNT( ups.id )
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- period_status = 1
- AND up.course_id = gc.course_id
- <if test="goodsId != null and goodsId !='' ">
- AND up.goods_id = #{goodsId}
- </if>
- and cme.section_id =up.section_id
- AND up.exam_id = cme.exam_id
- ) AS audit_num
- FROM
- course_menu_exam cme
- LEFT JOIN goods_course gc on gc.course_id = cme.course_id
- LEFT JOIN course_menu cm on cme.section_id = cm.menu_id
- where 1=1
- <if test="goodsId != null and goodsId !='' ">
- and gc.goods_id= #{goodsId}
- </if>
- AND cm.type=3 and cme.chapter_id=0 and cme.module_id=0 and cme.type=1 and cm.type=3
- </select>
- <select id="listperiodChapter" parameterType="map" resultMap="ClassPeriodChapterVo">
- SELECT
- cmc.sort,
- cc.chapter_id as id,
- cc.common_sign,
- cm.course_id,
- ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if> LIMIT 1) AS realname,
- ( SELECT u.user_id FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if> LIMIT 1) AS user_id,
- cc.`name` as type_name,
- ( SELECT COUNT( ccs.section_id ) FROM course_chapter_section ccs WHERE ccs.chapter_id = cc.chapter_id ) AS
- class_hours,
- 2 AS type,
- (
- SELECT
- usr.create_time
- FROM
- user_study_record usr
- LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id and ccs.chapter_id = usr.chapter_id
- WHERE
- ccs.chapter_id = cc.chapter_id
- AND usr.current_status = 1
- <if test="courseId != null ">
- AND usr.course_id=#{courseId}
- </if>
- <if test="moduleId != null">
- AND usr.module_id=#{moduleId}
- </if>
- <if test="goodsId != null and goodsId !='' ">
- AND usr.goods_id=#{goodsId}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- AND usr.grade_id=#{gradeId}
- </if>
- <if test="userId != null and userId !='' ">
- AND usr.user_id=#{userId}
- </if>
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND usr.order_goods_id=#{orderGoodsId}
- </if>
- ORDER BY
- usr.create_time ASC
- LIMIT 1
- ) AS study_start_time,
- (
- SELECT
- usr.update_time
- FROM
- user_study_record usr
- LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id and ccs.chapter_id = usr.chapter_id
- WHERE
- ccs.chapter_id = cc.chapter_id
- AND usr.current_status = 1
- <if test="courseId != null ">
- AND usr.course_id=#{courseId}
- </if>
- <if test="moduleId != null">
- AND usr.module_id=#{moduleId}
- </if>
- <if test="goodsId != null and goodsId !='' ">
- AND usr.goods_id=#{goodsId}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- AND usr.grade_id=#{gradeId}
- </if>
- <if test="userId != null and userId !='' ">
- AND usr.user_id=#{userId}
- </if>
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND usr.order_goods_id=#{orderGoodsId}
- </if>
- ORDER BY
- usr.create_time DESC
- LIMIT 1
- ) AS study_end_time,
- (
- SELECT
- ubr.performance
- FROM
- user_bank_record ubr
- LEFT JOIN course_menu_exam cme ON cme.exam_id = ubr.exam_id and cme.chapter_id = ubr.chapter_id
- WHERE 1=1
- AND ubr.current_status = 1
- AND ubr.report_status = 1
- <if test="moduleId != null ">
- AND ubr.module_id=#{moduleId}
- </if>
- <if test="goodsId != null">
- AND ubr.goods_id=#{goodsId}
- </if>
- <if test="moduleId != null ">
- AND cme.module_id=#{moduleId}
- </if>
- <if test="courseId != null">
- AND cme.course_id =#{courseId}
- </if>
- <if test="userId != null and userId !='' ">
- AND ubr.user_id=#{userId}
- </if>
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND ubr.order_goods_id=#{orderGoodsId}
- </if>
- AND cme.chapter_id = cmc.chapter_id
- LIMIT 1 ) AS performance
- FROM
- course_menu cm
- LEFT JOIN course_module_chapter cmc ON cm.menu_id = cmc.module_id and cm.type = 1
- LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id
- WHERE
- 1 = 1
- <if test="moduleId != null ">
- AND cmc.module_id=#{moduleId}
- </if>
- <if test="courseId != null">
- AND cm.course_id =#{courseId}
- </if>
- </select>
- <select id="listperiodExam" parameterType="map" resultMap="ClassPeriodSectionVo">
- SELECT
- cme.exam_id as id,
- cme.course_id,
- e.do_type,
- <if test="userId != null and userId !='' ">
- (SELECT u.realname FROM `user` u where 1=1
- and u.user_id = #{userId}
- ) as realname,
- </if>
- <if test="userId != null and userId !='' ">
- #{userId} as user_id,
- </if>
- (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
- null as class_hours,
- 4 as type,
- cme.chapter_id,
- cme.module_id
- FROM
- course_menu_exam cme
- LEFT JOIN exam e ON cme.exam_id = e.exam_id
- WHERE 1=1
- AND cme.type=1
- <if test="courseId != null">
- AND cme.course_id=#{courseId}
- </if>
- <if test="chapterId != null">
- AND cme.chapter_id =#{chapterId}
- </if>
- <if test="moduleId != null">
- AND cme.module_id =#{moduleId}
- </if>
- </select>
- <select id="listperiodModuleExam" parameterType="map" resultMap="ClassPeriodChapterVo">
- SELECT
- cme.exam_id as id,
- cme.course_id,
- e.do_type,
- <if test="userId != null and userId !='' ">
- (SELECT u.realname FROM `user` u where 1=1
- and u.user_id = #{userId}
- ) as realname,
- </if>
- <if test="userId != null and userId !='' ">
- #{userId} as user_id,
- </if>
- (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
- null as class_hours,
- 5 as type,
- cme.module_id
- FROM
- course_menu_exam cme
- LEFT JOIN exam e ON cme.exam_id = e.exam_id
- WHERE 1=1
- AND cme.type=3
- <if test="courseId != null">
- AND cme.course_id=#{courseId}
- </if>
- <if test="moduleId != null">
- AND cme.module_id =#{moduleId}
- </if>
- </select>
- <select id="listPeriodSection" parameterType="map" resultMap="ClassPeriodSectionVo">
- SELECT
- ccs.sort,
- cs.section_id AS id,
- #{courseId} AS course_id,
- <if test="userId != null and userId !='' ">
- (SELECT u.realname FROM `user` u where 1=1
- and u.user_id = #{userId}
- ) as realname,
- </if>
- <if test="userId != null and userId !='' ">
- #{userId} as user_id,
- </if>
- cs.NAME AS type_name,
- cs.duration_time,
- cs.section_type,
- cs.real_live_start_time,
- cs.real_live_end_time,
- cs.real_duration,
- NULL AS class_hours,
- cs.recording_url,
- 3 AS type
- FROM
- course_chapter_section ccs
- LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
- WHERE
- 1 = 1
- <if test="chapterId != null">
- AND ccs.chapter_id = #{chapterId}
- </if>
- ORDER BY
- ccs.sort
- </select>
- <select id="listPeriodSectionExam" parameterType="map" resultMap="ClassPeriodSectionVo">
- SELECT
- cme.exam_id as id,
- cme.course_id,
- (SELECT u.realname FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as realname,
- (SELECT u.user_id FROM `user` u where 1=1
- <if test="userId != null and userId !='' ">
- and u.user_id = #{userId}
- </if>
- ) as user_id,
- (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
- null as class_hours,
- 4 as type
- FROM
- course_menu_exam cme
- LEFT JOIN exam e ON cme.exam_id = e.exam_id
- WHERE 1=1
- and cme.module_id =0
- and cme.type =1
- <if test="courseId != null">
- AND cme.course_id=#{courseId}
- </if>
- <if test="chapterId != null ">
- AND cme.chapter_id = #{chapterId}
- </if>
- </select>
- <select id="selectStart" parameterType="map" resultType="long">
- SELECT
- rp.create_time
- FROM
- user_study_record_photo rp
- LEFT JOIN user_period_status ups ON rp.period_id = ups.id
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- 1=1
- <if test="orderGoodsId != null ">
- AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
- </if>
- AND ups.period_status = 1
- AND up.grade_id = #{gradeId}
- AND up.user_id = #{userId}
- ORDER BY
- rp.create_time ASC
- </select>
- <select id="selectStartNew" parameterType="map" resultType="long">
- SELECT
- rp.create_time
- FROM
- user_study_record_photo rp
- LEFT JOIN user_period_status ups ON rp.period_id = ups.id
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- 1=1
- <if test="orderGoodsId != null ">
- AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
- </if>
- AND ups.period_status = 1
- AND up.grade_id = #{gradeId}
- AND up.user_id = #{userId}
- ORDER BY
- rp.create_time ASC
- </select>
- <select id="selectStartNoPhoto" parameterType="map" resultType="long">
- SELECT
- ups.record_start_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- 1=1
- <if test="orderGoodsId != null ">
- AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
- </if>
- AND ups.period_status = 1
- AND up.grade_id = #{gradeId}
- AND up.user_id = #{userId}
- ORDER BY
- ups.record_start_time ASC
- limit 1
- </select>
- <select id="selectStartNoPhotoNew" parameterType="map" resultType="long">
- SELECT
- ups.record_start_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- 1=1
- <if test="orderGoodsId != null ">
- AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
- </if>
- AND ups.period_status = 1
- AND up.grade_id = #{gradeId}
- AND up.user_id = #{userId}
- ORDER BY
- ups.record_start_time ASC
- limit 1
- </select>
- <select id="selectEnd" parameterType="map" resultType="long">
- SELECT
- usr.end_time
- FROM
- user_study_record usr
- WHERE
- usr.goods_id = #{goodsId}
- AND usr.grade_id = #{gradeId}
- AND usr.user_id = #{userId} UNION
- SELECT
- ubr.update_time as end_time
- FROM
- user_bank_record ubr
- WHERE
- ubr.goods_id =#{goodsId}
- AND ubr.grade_id = #{gradeId}
- AND ubr.user_id = #{userId}
- ORDER BY end_time DESC
- </select>
- <select id="sendClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgu.user_id,
- cgu.order_goods_id,
- cg.class_start_time,
- cg.class_end_time,
- og.goods_id,
- cg.grade_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
- where 1=1
- and irb.remind_id =5
- and cgu.status = 1
- AND unix_timestamp(now()) BETWEEN cg.class_end_time-1728000 and cg.class_end_time-1641600
- </select>
- <select id="checkSendClassGradeUser" parameterType="map" resultType="long">
- SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = #{remindId} and #{userId} = iu.user_id and #{gradeId} = iu.grade_id and iu.system_status=3
- </select>
- <select id="sendTenClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgu.user_id,
- cgu.order_goods_id,
- cg.class_start_time,
- cg.class_end_time,
- og.goods_id,
- cg.grade_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
- where 1=1
- and irb.remind_id =6
- and cgu.status = 1
- AND unix_timestamp(now()) BETWEEN cg.class_end_time-864000 and cg.class_end_time-777600
- </select>
- <select id="sendTenAndFifteenClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgu.user_id,
- cgu.order_goods_id,
- cg.class_start_time,
- cg.class_end_time,
- og.goods_id,
- cg.grade_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- where 1=1
- and cgu.status = 1
- AND (unix_timestamp(now()) BETWEEN cg.class_end_time-950400 and cg.class_end_time-864000 or
- unix_timestamp(now()) BETWEEN cg.class_end_time-1382400 and cg.class_end_time-1296000)
- </select>
- <select id="checkTenClassGradeUser" parameterType="map" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgu.user_id,
- cgu.order_goods_id,
- cg.class_end_time,
- og.goods_id,
- g.goods_name,
- cg.class_name as grade_name
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON g.goods_id = og.goods_id
- where 1=1
- and cg.status = 1
- and cgu.status = 1
- and cgu.user_id = #{userId}
- and (cgu.period_status = -1 or cgu.period_status = 0)
- AND unix_timestamp(now()) BETWEEN cg.class_end_time-#{startTime} and cg.class_end_time-#{endTime}
- </select>
- <select id="sendFiveClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgu.user_id,
- cgu.order_goods_id,
- cg.class_start_time,
- cg.class_end_time,
- og.goods_id,
- cg.grade_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
- where 1=1
- and irb.remind_id =7
- and cgu.status = 1
- AND unix_timestamp(now()) BETWEEN cg.class_end_time-432000 and cg.class_end_time-345600
- </select>
- <select id="selectUserCount" parameterType="com.zhongzheng.modules.user.domain.User" resultType="long">
- SELECT
- COUNT( 1 )
- FROM
- `user`
- WHERE
- id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler} and user_id != #{userId} and `status` = 1
- </select>
- <select id="selectUserCertificate" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassGradeUserVoResult">
- </select>
- <select id="findChapterList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="CourseChapterResultVo">
- SELECT ui.* from (SELECT
- cc.chapter_id,
- cc.`name`,
- m.sort,
- cm.common_sign,
- (SELECT count(*) from course_chapter_section ccs WHERE ccs.chapter_id = cc.chapter_id) section_num
- FROM
- course_module_chapter p
- LEFT JOIN course_chapter cc ON p.chapter_id = cc.chapter_id
- LEFT JOIN course_menu m ON m.menu_id = p.module_id
- LEFT JOIN goods_course gc ON gc.course_id = m.course_id
- LEFT JOIN course_module cm ON p.module_id = cm.module_id
- WHERE
- gc.goods_id = #{goodsId}
- <if test="moduleId != null and moreCertificateStatus == 2 ">
- AND p.module_id = #{moduleId}
- </if>
- AND m.type = 1 UNION ALL
- SELECT
- cc.chapter_id,
- cc.`name`,
- m.sort,
- 0 as common_sign,
- (SELECT count(*) from course_chapter_section ccs WHERE ccs.chapter_id = cc.chapter_id) section_num
- FROM
- course_menu m
- LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
- LEFT JOIN goods_course gc ON gc.course_id = m.course_id
- WHERE
- gc.goods_id = #{goodsId}
- <if test="moduleId != null and moreCertificateStatus == 2 ">
- AND 1 = 0
- </if>
- AND m.type = 2)ui
- ORDER BY ui.sort
- </select>
- <select id="selectOfficialInfoCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">
- SELECT
- count(*)
- FROM
- class_grade_user cgu
- WHERE
- cgu.grade_id = #{gradeId}
- AND cgu.official_status = 1
- </select>
- <select id="selectLearnStatusCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">
- SELECT
- count(*)
- FROM
- class_grade_user cgu
- WHERE
- cgu.grade_id = #{gradeId}
- AND cgu.learn_status = 1
- </select>
- <select id="selectOfficialPeriodCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">
- SELECT
- count(*)
- FROM
- class_grade_user cgu
- WHERE
- cgu.grade_id = #{gradeId}
- AND cgu.period_plush = 1
- </select>
- <select id="selectOfficialNotPush" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- gu.*
- FROM
- class_grade g
- LEFT JOIN class_grade_user gu ON g.grade_id = gu.grade_id
- WHERE
- g.interface_push_id > 0
- AND g.official_name IS NOT NULL
- AND g.`status` = 1
- AND gu.`status` = 1
- AND gu.change_grade = 0
- AND IFNULL(gu.official_status,0) != 1
- </select>
- <select id="selectPeriodNotPush" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- gu.*
- FROM
- class_grade g
- LEFT JOIN class_grade_user gu ON g.grade_id = gu.grade_id
- WHERE
- g.interface_period_id > 0
- AND g.`status` = 1
- AND gu.`status` = 1
- AND gu.change_grade = 0
- AND IFNULL( gu.period_plush, 0 ) != 1
- AND gu.period_status = 1
- AND gu.official_status = 1
- <if test="gradeId != null and gradeId != ''">
- AND gu.grade_id = #{gradeId}
- </if>
- </select>
- <select id="selectGoodsGradeList" parameterType="Long" resultMap="ClassGradeUserGoodsVoResult">
- SELECT
- cgg.goods_id,
- cgg.grade_id,
- cgu.user_id,
- cgu.order_goods_id
- FROM
- class_grade_goods cgg
- LEFT JOIN class_grade_user cgu ON cgg.grade_id = cgu.grade_id
- WHERE
- cgg.goods_id = #{goodsId}
- AND cgu.user_id IS NOT NULL
- </select>
- <select id="queryCountList" parameterType="java.lang.Integer" resultMap="ClassGradeUserVoResult">
- SELECT
- cgu.*,
- cg.interface_account_id,
- cg.no_interface_account_id
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og on cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- WHERE
- cgu.`status` = 1
- and g.project_id = #{projectId}
- and g.business_id = #{businessId}
- <if test="all != null and all == 0">
- and (cg.interface_account_id is not null or cg.no_interface_account_id is not null)
- </if>
- </select>
- <select id="checkFinishRequiredCourse" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
- SELECT
- IFNULL(count(*),0)
- FROM
- class_grade_user cgu
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
- WHERE
- cgu.user_id = #{userId}
- AND cgu.period_status = -1
- AND (unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time)
- and g.business_id = #{businessId}
- and g.goods_id != #{goodsId}
- AND (
- SELECT
- IFNULL( count(*), 0 )
- FROM
- user_period up
- WHERE
- 1 = 1
- AND up.user_id = cgu.user_id
- AND up.grade_id = cgu.grade_id
- )>0
- </select>
- <select id="getFinishRequiredCourse" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
- SELECT
- g.goods_id
- FROM
- class_grade_user cgu
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
- WHERE
- cgu.user_id = #{userId}
- AND cgu.period_status = -1
- AND cgu.period_wait_time is null
- AND (unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time)
- and g.business_id = #{businessId}
- and g.goods_id != #{goodsId}
- and cgu.`status` = 1
- AND (
- SELECT
- IFNULL( count(*), 0 )
- FROM
- user_period up
- WHERE
- 1 = 1
- AND up.order_goods_id = cgu.order_goods_id
- )>0
- </select>
- <select id="getOrderGoods" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.order.domain.OrderGoods">
- SELECT
- og.*
- FROM
- order_goods og
- LEFT JOIN `order` o ON og.order_sn = o.order_sn
- WHERE
- o.user_id = #{userId}
- AND og.goods_id = #{goodsId}
- AND og.refund_status != 2
- AND og.pay_status != 1
- AND og.`status` = 1
- AND o.`status` = 1
- </select>
- <select id="getSevenPeriodStartTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
- SELECT
- p.create_time
- FROM
- user_study_record usr
- LEFT JOIN user_study_record_photo p ON usr.record_id = p.record_id
- LEFT JOIN course_module cm ON usr.module_id = cm.module_id
- WHERE
- usr.current_status = 1
- AND usr.user_id = #{userId}
- AND usr.grade_id = #{gradeId}
- AND cm.common_sign = 0
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND usr.order_goods_id = #{orderGoodsId}
- </if>
- AND P.create_time IS NOT NULL
- ORDER BY
- P.create_time
- LIMIT 1
- </select>
- <select id="getPeriodStartTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
- SELECT
- p.create_time
- FROM
- user_study_record usr
- LEFT JOIN user_study_record_photo p ON usr.record_id = p.record_id
- WHERE
- usr.current_status = 1
- AND usr.user_id = #{userId}
- AND usr.grade_id = #{gradeId}
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND usr.order_goods_id = #{orderGoodsId}
- </if>
- AND P.create_time IS NOT NULL
- ORDER BY
- P.create_time
- LIMIT 1
- </select>
- <select id="getPeriodEndTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
- SELECT
- ups.record_end_time
- FROM
- user_period_status ups
- LEFT JOIN user_period up ON up.id = ups.period_id
- WHERE
- 1 = 1
- AND up.user_id = #{userId}
- AND up.grade_id = #{gradeId}
- <if test="orderGoodsId != null and orderGoodsId !='' ">
- AND up.order_goods_id = #{orderGoodsId}
- </if>
- AND ups.period_status = 1
- ORDER BY
- ups.record_end_time DESC
- LIMIT 1
- </select>
- <select id="getClassInfoByUser" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.grade.domain.ClassGradeUser">
- SELECT
- cgu.*
- FROM
- class_grade_user cgu
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN goods g ON og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- WHERE
- cgu.`status` = 1
- AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), "继续教育" ) > 0
- AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), "施工现场专业人员" ) > 0
- AND og.`status` = 1
- AND og.refund_status != 2
- AND og.pay_status IN ( 2, 3, 4 )
- AND cgu.period_status != 1
- AND cgu.finish_status = 0
- AND cg.class_start_time <= UNIX_TIMESTAMP(NOW())
- AND cg.class_end_time >= UNIX_TIMESTAMP(NOW())
- AND (
- SELECT
- COUNT( usr.record_id )
- FROM
- user_study_record usr
- WHERE
- usr.order_goods_id = cgu.order_goods_id
- AND usr.user_id = cgu.user_id
- AND usr.current_status = 1
- ) > 0
- AND cgu.user_id = #{userId}
- </select>
- <select id="listVideoUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- u.user_account,
- u.user_id,
- cgu.`status`,
- u.realname,
- og.goods_id,
- u.id_card,
- cgu.grade_id,
- u.telphone,
- u.one_inch_photos,
- g.class_hours as class_hours,
- g.study_start_time as study_start_time,
- g.study_end_time as study_end_time,
- g.goods_name,
- g.code as goods_code,
- g.stand_price,
- g.goods_id,
- cgu.period_status,
- cg.class_start_time,
- cg.class_end_time,
- cg.class_name,
- cgu.period_plush,
- cgu.period_status_num,
- cgu.period_time,
- cgu.order_goods_id,
- IFNULL(ge.exam_num,0) as exam_num,
- cgu.period_wait_time as end_time,
- (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year,
- (SELECT og.service_start_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
- (SELECT og.service_end_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
- (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
- cet.education_name,
- cpt.project_name,
- m.category_name,
- cb.business_name
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- LEFT JOIN major m ON g.major_id = m.id
- LEFT JOIN (SELECT
- COUNT( m.id ) AS exam_num,
- c.goods_id
- FROM
- course_menu_exam m
- LEFT JOIN goods_course c ON m.course_id = c.course_id
- where
- m.type in (1,3)
- GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
- where 1=1
- and cgu.`status` =1
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectId != null and projectId != ''">
- AND g.project_id = #{projectId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="className != null and className !='' ">
- and cg.class_name like concat('%', #{className}, '%')
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (u.realname like concat('%', #{searchKey}, '%')
- or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
- or g.goods_name like concat('%', #{searchKey}, '%')
- or cg.class_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="userId != null and userId !='' ">
- AND cgu.user_id = #{userId}
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="telphone != null and telphone !='' ">
- AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="searchStartTime != null and searchStartTime != '' ">
- and (SELECT count(*) FROM user_study_record r where r.order_goods_id = cgu.order_goods_id AND r.create_time >= #{searchStartTime} )>0
- </if>
- <if test="searchEndTime != null and searchEndTime != '' ">
- and (SELECT count(*) FROM user_study_record r where r.order_goods_id = cgu.order_goods_id AND #{searchEndTime} >= r.create_time )>0
- </if>
- <if test="periodStartTime != null and periodStartTime !='' ">
- AND cgu.period_time >=#{periodStartTime}
- </if>
- <if test="periodEndTime != null and periodEndTime !='' ">
- AND #{periodEndTime} >= cgu.period_time
- </if>
- order by cgu.create_time desc
- </select>
- <select id="listBKUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultMap="ClassPeriodStudentVo">
- SELECT
- g.goods_name,
- cgu.create_time,
- g.year as goods_year,
- cet.education_name,
- cpt.project_name,
- m.category_name,
- cb.business_name,
- up.`status` as profile_status
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
- LEFT JOIN `user` u ON u.user_id = cgu.user_id
- LEFT JOIN goods g on og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- LEFT JOIN major m ON g.major_id = m.id
- LEFT JOIN user_profile up on cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
- where 1=1
- and cgu.`status` =1
- <if test="profileStatus != null and profileStatus != ''">
- AND up.`status` = #{profileStatus}
- </if>
- <if test="periodPlush != null and periodPlush != ''">
- AND cgu.period_plush = #{periodPlush}
- </if>
- <if test="officialStatus != null and officialStatus != ''">
- AND cgu.official_status = #{officialStatus}
- </if>
- <if test="changeGrade != null and changeGrade != ''">
- AND cgu.change_grade = #{changeGrade}
- </if>
- <if test="profileStatus != null and profileStatus != ''">
- AND up.status = #{profileStatus}
- </if>
- <if test="gradeId != null and gradeId !='' ">
- and cgu.grade_id = #{gradeId}
- </if>
- <if test="businessId != null and businessId != ''">
- AND g.business_id = #{businessId}
- </if>
- <if test="projectId != null and projectId != ''">
- AND g.project_id = #{projectId}
- </if>
- <if test="educationTypeId != null and educationTypeId != ''">
- AND g.education_type_id = #{educationTypeId}
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND g.school_id = #{schoolId}
- </if>
- <if test="majorId != null and majorId != ''">
- AND g.major_id = #{majorId}
- </if>
- <if test="periodStatus != null ">
- and cgu.period_status = #{periodStatus}
- </if>
- <if test="classStartTime != null and classStartTime != '' ">
- AND cg.class_start_time >= #{classStartTime}
- </if>
- <if test="classEndTime != null and classEndTime != '' ">
- AND #{classEndTime} >= cg.class_end_time
- </if>
- <if test="studyStatus != null and studyStatus == 1 ">
- and cgu.period_status = -1
- </if>
- <if test="studyStatus != null and studyStatus == 2 ">
- and cgu.period_status != -1
- </if>
- <if test="className != null and className !='' ">
- and cg.class_name like concat('%', #{className}, '%')
- </if>
- <if test="searchKey != null and searchKey != '' ">
- and (u.realname like concat('%', #{searchKey}, '%')
- or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
- or g.goods_name like concat('%', #{searchKey}, '%')
- or cg.class_name like concat('%', #{searchKey}, '%'))
- </if>
- <if test="userId != null and userId !='' ">
- AND u.user_id = #{userId}
- </if>
- <if test="idCard != null and idCard !='' ">
- AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="telphone != null and telphone !='' ">
- AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
- </if>
- <if test="searchStartTime != null and searchStartTime !='' ">
- AND cgu.create_time >= #{searchStartTime}
- </if>
- <if test="searchEndTime != null and searchEndTime !='' ">
- AND #{searchEndTime} >= cgu.create_time
- </if>
- <if test="periodStartTime != null and periodStartTime !='' ">
- AND cgu.period_time >= #{periodStartTime}
- </if>
- <if test="periodEndTime != null and periodEndTime !='' ">
- AND #{periodEndTime} >= cgu.period_time
- </if>
- order by cgu.create_time desc
- </select>
- <select id="getListUserSubscribe" resultType="com.zhongzheng.modules.user.vo.UserUsbRecordVo" parameterType="com.zhongzheng.modules.user.bo.UserUsbRecordBo">
- SELECT
- us.subscribe_id,
- us.create_time,
- g.goods_name,
- CONCAT(cet.education_name,'-',cb.business_name,cpt.project_name) AS businessName,
- m.category_name AS majorName,
- us.subscribe_status,
- us.apply_site_exam_time AS applyTime,
- us.apply_site_start_time AS applyStarTime,
- us.apply_site_end_time AS applyEndTime,
- us.apply_site_address AS applyAddress,
- '自带文具、身份证' AS remark
- FROM user_subscribe us
- LEFT JOIN order_goods og ON us.order_goods_id = og.order_goods_id
- LEFT JOIN goods g ON og.goods_id = g.goods_id
- LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
- LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
- LEFT JOIN course_business cb ON g.business_id = cb.id
- LEFT JOIN major m ON g.major_id = m.id
- WHERE 1=1 AND us.exam_status = 0
- <if test="userId != null and userId !='' ">
- AND us.user_id = #{userId}
- </if>
- <if test="subStartTime != null and subStartTime !='' ">
- AND us.create_time >= #{subStartTime}
- </if>
- <if test="subEndTime != null and subStartTime !='' ">
- AND us.create_time <= #{subEndTime}
- </if>
- <if test="educationTypeId != null and educationTypeId !='' ">
- AND cet.id = #{educationTypeId}
- </if>
- <if test="businessId != null and businessId !='' ">
- AND cb.id = #{businessId}
- </if>
- <if test="majorId != null and majorId !='' ">
- AND m.id = #{majorId}
- </if>
- <if test="goodsName != null and goodsName !='' ">
- AND g.goods_name like concat('%', #{goodsName}, '%')
- </if>
- <if test="subscribeStatus != null and subscribeStatus == 1">
- AND us.subscribe_status = 1 AND (TIME_TO_SEC(us.apply_site_end_time) + us.apply_site_exam_time) > UNIX_TIMESTAMP()
- </if>
- <if test="subscribeStatus != null and subscribeStatus == 2">
- AND us.subscribe_status = #{subscribeStatus}
- </if>
- <if test="subscribeStatus != null and subscribeStatus == 3">
- AND us.subscribe_status = 1 AND (TIME_TO_SEC(us.apply_site_end_time) + us.apply_site_exam_time) < UNIX_TIMESTAMP()
- </if>
- <if test="applySiteExamTime != null and applySiteExamTime != '' ">
- and us.apply_site_exam_time = #{applySiteExamTime}
- </if>
- <if test="monthStartTime != null and monthStartTime != '' ">
- and us.apply_site_exam_time >= #{monthStartTime}
- </if>
- <if test="monthEndTime != null and monthEndTime != '' ">
- and us.apply_site_exam_time <= #{monthEndTime}
- </if>
- <if test="applySiteStartTime != null and applySiteStartTime != '' ">
- and us.apply_site_start_time = #{applySiteStartTime}
- </if>
- <if test="applySiteEndTime != null and applySiteEndTime != '' ">
- and us.apply_site_end_time = #{applySiteEndTime}
- </if>
- order by us.create_time DESC
- </select>
- <update id="updateGradeUser" parameterType="com.zhongzheng.modules.grade.domain.ClassGradeUser" >
- update class_grade_user
- <set>
- <if test="sevenPushCheck != null">
- seven_push_check = #{sevenPushCheck},
- </if>
- <if test="sevenPushReason != null ">
- seven_push_reason=#{sevenPushReason},
- </if>
- <if test="updateTime != null ">
- update_time=#{updateTime},
- </if>
- <if test="sevenPushDate != null ">
- seven_push_date=#{sevenPushDate},
- </if>
- </set>
- where id = #{id}
- </update>
- <select id="selectUserNoTenant" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
- resultType="com.zhongzheng.modules.grade.domain.ClassGradeUser">
- SELECT
- g.*
- FROM
- class_grade_user g
- WHERE
- 1 = 1
- <if test="id != null ">
- AND g.id = #{id}
- </if>
- <if test="sevenPushReason != null ">
- AND g.seven_push_reason = #{sevenPushReason}
- </if>
- </select>
- <select id="getPeriodNotPush" resultType="com.zhongzheng.modules.grade.domain.ClassGradeUser">
- SELECT
- cgu.*
- FROM
- class_grade_user cgu
- LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
- WHERE
- cgu.`status` = 1
- AND cgu.period_status = 1
- AND cgu.period_plush = 0
- AND change_grade = 0
- AND cg.class_end_time < UNIX_TIMESTAMP(CURRENT_TIMESTAMP ())
- </select>
- <update id="updateListUserNoTenant" parameterType="map" >
- UPDATE class_grade_user SET seven_push_check = 0 WHERE seven_push_check > 2 and
- seven_push_reason = #{sevenPushReason}
- </update>
- </mapper>
|