ClassGradeUserMapper.xml 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper">
  6. <resultMap type="com.zhongzheng.modules.grade.domain.ClassGradeUser" id="ClassGradeUserResult">
  7. <result property="id" column="id"/>
  8. <result property="userId" column="user_id"/>
  9. <result property="gradeId" column="grade_id"/>
  10. <result property="status" column="status"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="updateTime" column="update_time"/>
  13. <result property="fromType" column="from_type"/>
  14. <result property="orderGoodsId" column="order_goods_id"/>
  15. <result property="periodWaitTime" column="period_wait_time"/>
  16. <result property="changeGrade" column="change_grade"/>
  17. <result property="periodTime" column="period_time"/>
  18. <result property="officialStatusMsg" column="official_status_msg"/>
  19. <result property="periodPlushMsg" column="period_plush_msg"/>
  20. <result property="officialStatusTime" column="official_status_time"/>
  21. <result property="periodPlushTime" column="period_plush_time"/>
  22. <result property="officialStatusNum" column="official_status_num"/>
  23. </resultMap>
  24. <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserVo" id="ClassGradeUserVoResult">
  25. <result property="id" column="id"/>
  26. <result property="userId" column="user_id"/>
  27. <result property="gradeId" column="grade_id"/>
  28. <result property="className" column="class_name"/>
  29. <result property="status" column="status"/>
  30. <result property="code" column="user_account"/>
  31. <result property="realName" column="realname"/>
  32. <result property="idCard" column="id_card"/>
  33. <result property="createBy" column="create_by"/>
  34. <result property="telPhone" column="telphone"/>
  35. <result property="changeGrade" column="change_grade"/>
  36. <result property="interfacePushId" column="interface_push_id"/>
  37. <result property="classStatus" column="class_status"/>
  38. <result property="officialName" column="official_name"/>
  39. <result property="classStartTime" column="class_start_time"/>
  40. <result property="classEndTime" column="class_end_time"/>
  41. <result property="officialStatusNum" column="official_status_num"/>
  42. <result property="periodTime" column="period_time"/>
  43. </resultMap>
  44. <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo" id="ClassGradeUserGoodsVoResult">
  45. <result property="id" column="id"/>
  46. <result property="userId" column="user_id"/>
  47. <result property="gradeId" column="grade_id"/>
  48. <result property="status" column="status"/>
  49. <result property="goodsCode" column="goods_code"/>
  50. <result property="goodsName" column="goods_name"/>
  51. <result property="gradeStatus" column="grade_status"/>
  52. <result property="gradeCode" column="grade_code"/>
  53. <result property="gradeName" column="grade_name"/>
  54. <result property="year" column="year"/>
  55. <result property="educationName" column="education_name"/>
  56. <result property="projectName" column="project_name"/>
  57. <result property="businessName" column="business_name"/>
  58. <result property="schoolName" column="school_name"/>
  59. <result property="createTime" column="create_time"/>
  60. <result property="createBy" column="create_by"/>
  61. <result property="goodsId" column="goods_id"/>
  62. <result property="classStartTime" column="class_start_time"/>
  63. <result property="classEndTime" column="class_end_time"/>
  64. </resultMap>
  65. <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo" id="ClassPeriodStudentVo">
  66. <result property="userId" column="user_id"/>
  67. <result property="gradeId" column="grade_id"/>
  68. <result property="studentCode" column="user_account"/>
  69. <result property="realName" column="realname"/>
  70. <result property="idCard" column="id_card"/>
  71. <result property="telPhone" column="telphone"/>
  72. <result property="status" column="status"/>
  73. <result property="classHours" column="class_hours"/>
  74. <result property="periodStatus" column="period_status"/>
  75. <result property="secAllNum" column="sec_all_num"/>
  76. <result property="examNum" column="exam_num"/>
  77. <result property="recordNum" column="record_num"/>
  78. <result property="periodPlush" column="period_plush"/>
  79. <result property="startTime" column="start_time"/>
  80. <result property="endTime" column="end_time"/>
  81. <result property="studyStartTime" column="study_start_time"/>
  82. <result property="studyEndTime" column="study_end_time"/>
  83. <result property="rebuildNum" column="rebuild_num"/>
  84. <result property="profileStatus" column="profile_status"/>
  85. <result property="className" column="class_name"/>
  86. <result property="goodsName" column="goods_name"/>
  87. <result property="standPrice" column="stand_price"/>
  88. <result property="goodsCode" column="goods_code"/>
  89. <result property="keyValue" column="key_value"/>
  90. <result property="classStartTime" column="class_start_time"/>
  91. <result property="classEndTime" column="class_end_time"/>
  92. </resultMap>
  93. <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
  94. <result property="userId" column="user_id"/>
  95. <result property="studentCode" column="user_account"/>
  96. <result property="realName" column="realname"/>
  97. <result property="oneInchPhotos" column="one_inch_photos"/>
  98. <result property="idCardImg1" column="id_card_img1"/>
  99. <result property="idCardImg2" column="id_card_img2"/>
  100. <result property="idCard" column="id_card"/>
  101. <result property="telPhone" column="telphone"/>
  102. <result property="secAllNum" column="sec_all_num"/>
  103. <result property="examNum" column="exam_num"/>
  104. <result property="recordNum" column="record_num"/>
  105. <result property="pass" column="pass"/>
  106. <result property="cheat" column="cheat"/>
  107. <result property="pending" column="pending"/>
  108. <result property="examPass" column="exam_pass"/>
  109. <result property="examPending" column="exam_pending"/>
  110. <result property="examCheat" column="exam_cheat"/>
  111. <result property="keyValue" column="key_value"/>
  112. <result property="periodStatus" column="period_status"/>
  113. <result property="studyStartTime" column="study_start_time"/>
  114. <result property="studyEndTime" column="study_end_time"/>
  115. </resultMap>
  116. <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
  117. <result property="userId" column="user_id"/>
  118. <result property="id" column="id"/>
  119. <result property="typeName" column="type_name"/>
  120. <result property="realName" column="realname"/>
  121. <result property="classHours" column="class_hours"/>
  122. <result property="studyStartTime" column="study_start_time"/>
  123. <result property="status" column="status"/>
  124. <result property="auditTime" column="audit_time"/>
  125. <result property="type" column="type"/>
  126. <result property="sort" column="sort"/>
  127. <result property="courseId" column="course_id"/>
  128. <result property="studyEndTime" column="study_end_time"/>
  129. <result property="durationTime" column="duration_time"/>
  130. <result property="courseSort" column="course_sort"/>
  131. </resultMap>
  132. <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
  133. <result property="userId" column="user_id"/>
  134. <result property="id" column="id"/>
  135. <result property="courseId" column="course_id"/>
  136. <result property="typeName" column="type_name"/>
  137. <result property="realName" column="realname"/>
  138. <result property="classHours" column="class_hours"/>
  139. <result property="studyStartTime" column="study_start_time"/>
  140. <result property="status" column="status"/>
  141. <result property="auditTime" column="audit_time"/>
  142. <result property="type" column="type"/>
  143. <result property="studyEndTime" column="study_end_time"/>
  144. <result property="performance" column="performance"/>
  145. <result property="sort" column="sort"/>
  146. </resultMap>
  147. <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
  148. <result property="userId" column="user_id"/>
  149. <result property="id" column="id"/>
  150. <result property="typeName" column="type_name"/>
  151. <result property="realName" column="realname"/>
  152. <result property="classHours" column="class_hours"/>
  153. <result property="durationTime" column="duration_time"/>
  154. <result property="studyStartTime" column="study_start_time"/>
  155. <result property="status" column="status"/>
  156. <result property="auditTime" column="audit_time"/>
  157. <result property="type" column="type"/>
  158. <result property="studyEndTime" column="study_end_time"/>
  159. <result property="auditNum" column="audit_num"/>
  160. <result property="sort" column="sort"/>
  161. </resultMap>
  162. <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterVo" id="CourseChapterResultVo">
  163. <result property="chapterId" column="chapter_id"/>
  164. <result property="name" column="name"/>
  165. </resultMap>
  166. <select id="selectUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  167. resultMap="ClassGradeUserVoResult">
  168. SELECT
  169. g.*,
  170. u.user_account,
  171. u.realname,
  172. u.id_card,
  173. u.telphone,
  174. cg.class_name,
  175. cg.official_name,
  176. cg.class_status,
  177. cg.interface_push_id,
  178. cg.class_start_time,
  179. cg.class_end_time,
  180. g.official_status_num,
  181. g.period_time
  182. FROM
  183. class_grade_user g
  184. LEFT JOIN `user` u ON g.user_id = u.user_id
  185. LEFT JOIN class_grade cg ON cg.grade_id = g.grade_id
  186. WHERE
  187. 1 = 1
  188. AND g.grade_id = #{gradeId}
  189. AND g.user_id = #{userId}
  190. </select>
  191. <select id="select" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  192. resultMap="ClassGradeUserVoResult">
  193. SELECT
  194. g.*,
  195. u.user_account,
  196. u.realname,
  197. u.id_card,
  198. u.telphone
  199. FROM
  200. class_grade_user g
  201. LEFT JOIN `user` u ON g.user_id = u.user_id
  202. WHERE
  203. 1 = 1
  204. <if test="status != null and status.size()!=0 ">
  205. AND g.status in
  206. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  207. #{item}
  208. </foreach>
  209. </if>
  210. <if test="gradeId != null and gradeId != ''">
  211. AND g.grade_id = #{gradeId}
  212. </if>
  213. <if test="userId != null and userId != ''">
  214. AND g.user_id = #{userId}
  215. </if>
  216. <if test="classStartTime != null or classEndTime != null ">
  217. AND #{classStartTime} BETWEEN g.class_start_time
  218. </if>
  219. order by g.update_time desc
  220. </select>
  221. <select id="listUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  222. resultMap="ClassGradeUserGoodsVoResult">
  223. SELECT
  224. * ,
  225. (select `code` FROM goods g LEFT JOIN class_grade_goods c on g.goods_id = c.goods_id where c.grade_id =
  226. u.grade_id) as goods_code,
  227. (select `year` FROM goods g LEFT JOIN class_grade_goods c on g.goods_id = c.goods_id where c.grade_id =
  228. u.grade_id) as year,
  229. (select goods_name FROM goods g LEFT JOIN class_grade_goods c on g.goods_id = c.goods_id where c.grade_id =
  230. u.grade_id) as goods_name,
  231. (select b.business_name FROM course_business b LEFT JOIN goods g on b.id = g.business_id LEFT JOIN
  232. class_grade_goods c on g.goods_id = c.goods_id where c.grade_id = u.grade_id) as business_name,
  233. (select b.project_name FROM course_project_type b LEFT JOIN goods g on b.id = g.project_id LEFT JOIN
  234. class_grade_goods c on g.goods_id = c.goods_id where c.grade_id = u.grade_id) as project_name,
  235. (select b.school_name FROM school b LEFT JOIN goods g on b.id = g.school_id LEFT JOIN class_grade_goods c on
  236. g.goods_id = c.goods_id where c.grade_id = u.grade_id) as school_name,
  237. (select b.education_name FROM course_education_type b LEFT JOIN goods g on b.id = g.education_type_id LEFT JOIN
  238. class_grade_goods c on g.goods_id = c.goods_id where c.grade_id = u.grade_id) as education_name,
  239. (SELECT g.grade_code FROM class_grade g where u.grade_id = g.grade_id) as grade_code,
  240. (SELECT g.class_name FROM class_grade g where u.grade_id = g.grade_id) as grade_name,
  241. (SELECT g.status FROM class_grade g where u.grade_id = g.grade_id) as grade_status
  242. FROM
  243. class_grade_user u
  244. where 1=1
  245. <if test="status != null and status.size()!=0 ">
  246. AND u.status in
  247. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  248. #{item}
  249. </foreach>
  250. </if>
  251. <if test="userId != null and userId != ''">
  252. and u.user_id= #{userId}
  253. </if>
  254. order by u.update_time desc
  255. </select>
  256. <select id="listUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  257. resultMap="ClassPeriodStudentVo">
  258. SELECT
  259. u.user_account,
  260. u.user_id,
  261. cgu.`status`,
  262. u.realname,
  263. cgg.goods_id,
  264. u.id_card,
  265. cgu.grade_id,
  266. u.telphone,
  267. up.`status` as profile_status,
  268. g.class_hours as class_hours,
  269. g.study_start_time as study_start_time,
  270. g.study_end_time as study_end_time,
  271. g.goods_name,
  272. g.code as goods_code,
  273. g.stand_price,
  274. cgu.period_status,
  275. cg.class_start_time,
  276. cg.class_end_time,
  277. cg.class_name,
  278. cgu.period_plush,
  279. IFNULL(ge.exam_num,0) as exam_num,
  280. <if test="userPhoto != null and userPhoto == 1">
  281. up.key_value,
  282. </if>
  283. cgu.period_time as end_time,
  284. (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.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
  285. <if test="userPhoto == null">
  286. ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) and up.grade_id = cgu.grade_id and up.user_id = u.user_id
  287. 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
  288. </if>
  289. FROM
  290. class_grade_user cgu
  291. LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
  292. LEFT JOIN class_grade_goods cgg on cg.grade_id=cgg.grade_id
  293. LEFT JOIN (SELECT
  294. COUNT( m.id ) AS exam_num,
  295. c.goods_id
  296. FROM
  297. course_menu_exam m
  298. LEFT JOIN goods_course c ON m.course_id = c.course_id
  299. where
  300. m.type = 1
  301. GROUP BY c.goods_id ) ge on cgg.goods_id = ge.goods_id
  302. LEFT JOIN `user` u ON u.user_id = cgu.user_id
  303. LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = cgg.goods_id and up.type_status=1 and up.current_status = 1
  304. LEFT JOIN goods g on cgg.goods_id = g.goods_id
  305. where 1=1
  306. and cgu.`status` =1
  307. <if test="officialStatus != null and officialStatus != ''">
  308. AND cgu.official_status = #{officialStatus}
  309. </if>
  310. <if test="changeGrade != null and changeGrade != ''">
  311. AND cgu.change_grade = #{changeGrade}
  312. </if>
  313. <if test="profileStatus != null and profileStatus != ''">
  314. AND up.status = #{profileStatus}
  315. </if>
  316. <if test="gradeId != null and gradeId !='' ">
  317. and cgu.grade_id = #{gradeId}
  318. </if>
  319. <if test="businessId != null and businessId != ''">
  320. AND g.business_id = #{businessId}
  321. </if>
  322. <if test="educationTypeId != null and educationTypeId != ''">
  323. AND g.education_type_id = #{educationTypeId}
  324. </if>
  325. <if test="schoolId != null and schoolId != ''">
  326. AND g.school_id = #{schoolId}
  327. </if>
  328. <if test="majorId != null and majorId != ''">
  329. AND g.major_id = #{majorId}
  330. </if>
  331. <if test="periodStatus != null ">
  332. and cgu.period_status = #{periodStatus}
  333. </if>
  334. <if test="classStartTime != null and classStartTime != '' ">
  335. AND cg.class_start_time >= #{classStartTime}
  336. </if>
  337. <if test="classEndTime != null and classEndTime != '' ">
  338. AND #{classEndTime} >= cg.class_end_time
  339. </if>
  340. <if test="studyStatus != null and studyStatus == 1 ">
  341. and cgu.period_status = -1
  342. </if>
  343. <if test="studyStatus != null and studyStatus == 2 ">
  344. and cgu.period_status != -1
  345. </if>
  346. <if test="searchKey != null and searchKey != '' ">
  347. and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%') or g.goods_name like concat('%', #{searchKey}, '%') or g.code like concat('%', #{searchKey}, '%'))
  348. </if>
  349. <if test="searchStartTime != null and searchStartTime !='' ">
  350. AND cgu.create_time >=#{searchStartTime}
  351. </if>
  352. <if test="searchEndTime != null and searchEndTime !='' ">
  353. AND {searchEndTime} >= cgu.create_time
  354. </if>
  355. <if test="periodStatus != 2 ">
  356. order by cgu.update_time desc
  357. </if>
  358. <if test="periodStatus == 2 ">
  359. order by cgu.period_wait_time,cgu.create_time
  360. </if>
  361. </select>
  362. <select id="userPeriodStatus" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  363. resultMap="ClassPeriodStudentVo">
  364. SELECT
  365. IFNULL(ge.exam_num,0) as exam_num,
  366. cg.class_start_time,
  367. cg.class_end_time,
  368. g.study_start_time,
  369. g.study_end_time,
  370. (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
  371. = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
  372. cgu.user_id,
  373. cgg.goods_id
  374. FROM
  375. class_grade_user cgu
  376. LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
  377. LEFT JOIN class_grade_goods cgg on cg.grade_id=cgg.grade_id
  378. LEFT JOIN goods g on g.goods_id=cgg.goods_id
  379. LEFT JOIN (SELECT
  380. COUNT( m.id ) AS exam_num,
  381. c.goods_id
  382. FROM
  383. course_menu_exam m
  384. LEFT JOIN goods_course c ON m.course_id = c.course_id
  385. where
  386. m.type = 1
  387. GROUP BY c.goods_id ) ge on cgg.goods_id = ge.goods_id
  388. where 1=1
  389. and cgu.`status` =1
  390. <if test="gradeId != null and gradeId !='' ">
  391. and cgu.grade_id = #{gradeId}
  392. </if>
  393. <if test="userId != null ">
  394. and cgu.user_id = #{userId}
  395. </if>
  396. LIMIT 1
  397. </select>
  398. <select id="listPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  399. resultMap="ClassPeriodUserVo">
  400. SELECT
  401. u.user_account,
  402. u.realname,
  403. u.id_card,
  404. u.user_id,
  405. u.telphone,
  406. (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) as goods_id,
  407. u.one_inch_photos,
  408. u.id_card_img1,
  409. u.id_card_img2,
  410. cgu.period_status,
  411. (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN
  412. class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_id and m.type = 1 ) as exam_num,
  413. (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.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.current_status=1) as record_num,
  414. (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
  415. 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.type = 1) as pass,
  416. (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
  417. 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.user_id = #{userId} and up.type = 1) as pending,
  418. (SELECT
  419. 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`
  420. =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 1) as cheat,
  421. (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
  422. ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cg.grade_id and up.type = 2) as exam_pass,
  423. (SELECT
  424. 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`
  425. =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_cheat,
  426. (SELECT
  427. 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`
  428. =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.type = 2) as exam_pending,
  429. (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.current_status = 1 and up.type_status =1 LIMIT 1) as key_value
  430. <if test="userId != null and userId !='' ">
  431. ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_start_time,
  432. (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_end_time
  433. </if>
  434. FROM
  435. class_grade_user cgu
  436. LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
  437. LEFT JOIN `user` u ON u.user_id = cgu.user_id
  438. where 1=1
  439. <if test="userId != null and userId !='' ">
  440. and u.user_id = #{userId}
  441. </if>
  442. <if test="gradeId != null and gradeId !='' ">
  443. and cgu.grade_id = #{gradeId}
  444. </if>
  445. <if test="periodStatus != null and periodStatus !='' ">
  446. and cgu.period_status = #{periodStatus}
  447. </if>
  448. LIMIT 1
  449. </select>
  450. <select id="listPeriodAudit" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  451. resultMap="ClassPeriodVo">
  452. SELECT
  453. gc.sort as course_sort,
  454. cm.sort,
  455. cm.menu_id as id,
  456. cm.course_id,
  457. (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
  458. and u.user_id = #{userId}
  459. </if>) as realname,
  460. (SELECT u.user_id FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
  461. and u.user_id = #{userId}
  462. </if>) as user_id,
  463. (SELECT cm.module_name FROM course_module cm where cm.menu_id = cm.module_id) as type_name,
  464. (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs LEFT JOIN course_module_chapter cmc on
  465. cmc.chapter_id=ccs.chapter_id where cmc.module_id=cm.menu_id) as class_hours,
  466. 1 as type,
  467. NULL as study_start_time,
  468. NULL as study_end_time
  469. FROM
  470. course_menu cm
  471. LEFT JOIN goods_course gc on gc.course_id = cm.course_id
  472. where 1=1
  473. <if test="goodsId != null and goodsId !='' ">
  474. and gc.goods_id=#{goodsId}
  475. </if>
  476. AND cm.type=1
  477. UNION
  478. SELECT
  479. gc.sort as course_sort,
  480. cm.sort,
  481. cm.menu_id as id,
  482. cm.course_id,
  483. (SELECT u.realname FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
  484. and u.user_id = #{userId}
  485. </if>) as realname,
  486. (SELECT u.user_id FROM `user` u where 1=1 <if test="userId != null and userId !='' ">
  487. and u.user_id = #{userId}
  488. </if>) as user_id,
  489. (SELECT cc.`name` FROM course_chapter cc where cm.menu_id = cc.chapter_id) as type_name,
  490. (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs where ccs.chapter_id=cm.menu_id) as class_hours,
  491. 2 as type,
  492. (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
  493. 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} ORDER BY usr.create_time ASC
  494. limit 1) as study_start_time,
  495. (SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
  496. 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} ORDER BY usr.create_time DESC
  497. limit 1) as study_end_time
  498. FROM
  499. course_menu cm
  500. LEFT JOIN goods_course gc on gc.course_id = cm.course_id
  501. where 1=1 <if test="goodsId != null and goodsId !='' ">
  502. and gc.goods_id=#{goodsId}
  503. </if> AND cm.type=2
  504. </select>
  505. <select id="listPeriodAuditSection" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  506. resultMap="ClassPeriodVo">
  507. SELECT
  508. gc.sort as course_sort,
  509. cm.sort,
  510. cm.menu_id as id,
  511. cm.course_id,
  512. (SELECT u.realname FROM `user` u where 1=1
  513. <if test="userId != null and userId !='' ">
  514. and u.user_id = #{userId}
  515. </if>
  516. ) as realname,
  517. (SELECT u.user_id FROM `user` u where 1=1
  518. <if test="userId != null and userId !='' ">
  519. and u.user_id = #{userId}
  520. </if>
  521. ) as user_id,
  522. cs.`name` as type_name,
  523. cs.duration_time,
  524. null as class_hours,
  525. 3 as type
  526. FROM
  527. course_menu cm
  528. LEFT JOIN course_section cs on cm.menu_id = cs.section_id
  529. LEFT JOIN goods_course gc on gc.course_id = cm.course_id
  530. where 1=1
  531. <if test="goodsId != null and goodsId !='' ">
  532. and gc.goods_id = #{goodsId}
  533. </if>
  534. AND cm.type=3
  535. </select>
  536. <select id="listPeriodAuditExam" parameterType="map" resultMap="ClassPeriodChapterVo">
  537. SELECT
  538. cme.exam_id as id,
  539. cme.course_id,
  540. (SELECT u.realname FROM `user` u where 1=1
  541. <if test="userId != null and userId !='' ">
  542. and u.user_id = #{userId}
  543. </if>
  544. ) as realname,
  545. (SELECT u.user_id FROM `user` u where 1=1
  546. <if test="userId != null and userId !='' ">
  547. and u.user_id = #{userId}
  548. </if>
  549. ) as user_id,
  550. (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
  551. null as class_hours,
  552. 4 as type,
  553. (
  554. SELECT
  555. ups.record_start_time
  556. FROM
  557. user_period_status ups
  558. LEFT JOIN user_period up ON up.id = ups.period_id
  559. WHERE
  560. period_status = 1
  561. AND up.course_id = gc.course_id
  562. <if test="goodsId != null and goodsId !='' ">
  563. AND up.goods_id = #{goodsId}
  564. </if>
  565. and cme.section_id =up.section_id
  566. AND up.exam_id = cme.exam_id
  567. ) AS study_start_time,
  568. (
  569. SELECT
  570. ups.record_end_time
  571. FROM
  572. user_period_status ups
  573. LEFT JOIN user_period up ON up.id = ups.period_id
  574. WHERE
  575. period_status = 1
  576. AND up.course_id = gc.course_id
  577. <if test="goodsId != null and goodsId !='' ">
  578. AND up.goods_id = #{goodsId}
  579. </if>
  580. AND up.exam_id = cme.exam_id
  581. ) AS study_end_time,
  582. (
  583. SELECT
  584. ups.`status`
  585. FROM
  586. user_period_status ups
  587. LEFT JOIN user_period up ON up.id = ups.period_id
  588. WHERE
  589. period_status = 1
  590. AND up.course_id = gc.course_id
  591. <if test="goodsId != null and goodsId !='' ">
  592. AND up.goods_id = #{goodsId}
  593. </if>
  594. and cme.section_id =up.section_id
  595. AND up.exam_id = cme.exam_id
  596. ) AS STATUS,
  597. (
  598. SELECT
  599. ups.create_time
  600. FROM
  601. user_period_status ups
  602. LEFT JOIN user_period up ON up.id = ups.period_id
  603. WHERE
  604. period_status = 1
  605. AND up.course_id = gc.course_id
  606. <if test="goodsId != null and goodsId !='' ">
  607. AND up.goods_id = #{goodsId}
  608. </if>
  609. and cme.section_id =up.section_id
  610. AND up.exam_id = cme.exam_id
  611. ) AS audit_time,
  612. (
  613. SELECT
  614. COUNT( ups.id )
  615. FROM
  616. user_period_status ups
  617. LEFT JOIN user_period up ON up.id = ups.period_id
  618. WHERE
  619. period_status = 1
  620. AND up.course_id = gc.course_id
  621. <if test="goodsId != null and goodsId !='' ">
  622. AND up.goods_id = #{goodsId}
  623. </if>
  624. and cme.section_id =up.section_id
  625. AND up.exam_id = cme.exam_id
  626. ) AS audit_num
  627. FROM
  628. course_menu_exam cme
  629. LEFT JOIN goods_course gc on gc.course_id = cme.course_id
  630. LEFT JOIN course_menu cm on cme.section_id = cm.menu_id
  631. where 1=1
  632. <if test="goodsId != null and goodsId !='' ">
  633. and gc.goods_id= #{goodsId}
  634. </if>
  635. AND cm.type=3 and cme.chapter_id=0 and cme.module_id=0 and cme.type=1 and cm.type=3
  636. </select>
  637. <select id="listperiodChapter" parameterType="map" resultMap="ClassPeriodChapterVo">
  638. SELECT
  639. cmc.sort,
  640. cc.chapter_id as id,
  641. cm.course_id,
  642. ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
  643. and u.user_id = #{userId}
  644. </if> LIMIT 1) AS realname,
  645. ( SELECT u.user_id FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
  646. and u.user_id = #{userId}
  647. </if> LIMIT 1) AS user_id,
  648. cc.`name` as type_name,
  649. ( SELECT COUNT( ccs.section_id ) FROM course_chapter_section ccs WHERE ccs.chapter_id = cc.chapter_id ) AS
  650. class_hours,
  651. 2 AS type,
  652. (
  653. SELECT
  654. usr.create_time
  655. FROM
  656. user_study_record usr
  657. LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id and ccs.chapter_id = usr.chapter_id
  658. WHERE
  659. ccs.chapter_id = cc.chapter_id
  660. AND usr.current_status = 1
  661. <if test="courseId != null and courseId !='' ">
  662. AND usr.course_id=#{courseId}
  663. </if>
  664. <if test="moduleId != null and moduleId !='' ">
  665. AND usr.module_id=#{moduleId}
  666. </if>
  667. <if test="goodsId != null and goodsId !='' ">
  668. AND usr.goods_id=#{goodsId}
  669. </if>
  670. <if test="gradeId != null and gradeId !='' ">
  671. AND usr.grade_id=#{gradeId}
  672. </if>
  673. <if test="userId != null and userId !='' ">
  674. AND usr.user_id=#{userId}
  675. </if>
  676. ORDER BY
  677. usr.create_time ASC
  678. LIMIT 1
  679. ) AS study_start_time,
  680. (
  681. SELECT
  682. usr.update_time
  683. FROM
  684. user_study_record usr
  685. LEFT JOIN course_chapter_section ccs ON usr.section_id = ccs.section_id and ccs.chapter_id = usr.chapter_id
  686. WHERE
  687. ccs.chapter_id = cc.chapter_id
  688. AND usr.current_status = 1
  689. <if test="courseId != null and courseId !='' ">
  690. AND usr.course_id=#{courseId}
  691. </if>
  692. <if test="moduleId != null and moduleId !='' ">
  693. AND usr.module_id=#{moduleId}
  694. </if>
  695. <if test="goodsId != null and goodsId !='' ">
  696. AND usr.goods_id=#{goodsId}
  697. </if>
  698. <if test="gradeId != null and gradeId !='' ">
  699. AND usr.grade_id=#{gradeId}
  700. </if>
  701. <if test="userId != null and userId !='' ">
  702. AND usr.user_id=#{userId}
  703. </if>
  704. ORDER BY
  705. usr.create_time DESC
  706. LIMIT 1
  707. ) AS study_end_time,
  708. (
  709. SELECT
  710. ubr.performance
  711. FROM
  712. user_bank_record ubr
  713. LEFT JOIN course_menu_exam cme ON cme.exam_id = ubr.exam_id and cme.chapter_id = ubr.chapter_id
  714. WHERE 1=1
  715. AND ubr.current_status = 1
  716. <if test="moduleId != null and moduleId !='' ">
  717. AND ubr.module_id=#{moduleId}
  718. </if>
  719. <if test="goodsId != null and goodsId !='' ">
  720. AND ubr.goods_id=#{goodsId}
  721. </if>
  722. <if test="moduleId != null and moduleId !='' ">
  723. AND cme.module_id=#{moduleId}
  724. </if>
  725. <if test="courseId != null and courseId !='' ">
  726. AND cme.course_id =#{courseId}
  727. </if>
  728. <if test="userId != null and userId !='' ">
  729. AND ubr.user_id=#{userId}
  730. </if>
  731. AND cme.chapter_id = cmc.chapter_id
  732. LIMIT 1 ) AS performance
  733. FROM
  734. course_menu cm
  735. LEFT JOIN course_module_chapter cmc ON cm.menu_id = cmc.module_id
  736. LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id
  737. WHERE
  738. 1 = 1
  739. <if test="moduleId != null and moduleId !='' ">
  740. AND cmc.module_id=#{moduleId}
  741. </if>
  742. <if test="courseId != null and courseId !='' ">
  743. AND cm.course_id =#{courseId}
  744. </if>
  745. </select>
  746. <select id="listperiodExam" parameterType="map" resultMap="ClassPeriodSectionVo">
  747. SELECT
  748. cme.exam_id as id,
  749. cme.course_id,
  750. (SELECT u.realname FROM `user` u where 1=1
  751. <if test="userId != null and userId !='' ">
  752. and u.user_id = #{userId}
  753. </if>
  754. ) as realname,
  755. (SELECT u.user_id FROM `user` u where 1=1
  756. <if test="userId != null and userId !='' ">
  757. and u.user_id = #{userId}
  758. </if>
  759. ) as user_id,
  760. (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
  761. null as class_hours,
  762. 4 as type
  763. FROM
  764. course_menu_exam cme
  765. LEFT JOIN exam e ON cme.exam_id = e.exam_id
  766. WHERE 1=1
  767. <if test="courseId != null and courseId !='' ">
  768. AND cme.course_id=#{courseId}
  769. </if>
  770. <if test="chapterId != null and chapterId !='' ">
  771. AND cme.chapter_id =#{chapterId}
  772. </if>
  773. <if test="moduleId != null and moduleId !='' ">
  774. AND cme.module_id =#{moduleId}
  775. </if>
  776. </select>
  777. <select id="listPeriodSection" parameterType="map" resultMap="ClassPeriodSectionVo">
  778. SELECT
  779. ccs.sort,
  780. cs.section_id AS id,
  781. #{courseId} AS course_id,
  782. ( SELECT u.realname FROM `user` u WHERE 1 = 1 <if test="userId != null and userId !='' ">
  783. and u.user_id = #{userId}
  784. </if> ) AS realname,
  785. ( SELECT u.user_id FROM `user` u WHERE 1 = 1 <if test="userId != null and userId !='' ">
  786. and u.user_id = #{userId}
  787. </if> ) AS user_id,
  788. cs.NAME AS type_name,
  789. cs.duration_time,
  790. NULL AS class_hours,
  791. 3 AS type
  792. FROM
  793. course_chapter_section ccs
  794. LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
  795. WHERE
  796. 1 = 1
  797. <if test="chapterId != null and chapterId !='' ">
  798. AND ccs.chapter_id = #{chapterId}
  799. </if>
  800. </select>
  801. <select id="listPeriodSectionExam" parameterType="map" resultMap="ClassPeriodSectionVo">
  802. SELECT
  803. cme.exam_id as id,
  804. cme.course_id,
  805. (SELECT u.realname FROM `user` u where 1=1
  806. <if test="userId != null and userId !='' ">
  807. and u.user_id = #{userId}
  808. </if>
  809. ) as realname,
  810. (SELECT u.user_id FROM `user` u where 1=1
  811. <if test="userId != null and userId !='' ">
  812. and u.user_id = #{userId}
  813. </if>
  814. ) as user_id,
  815. (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
  816. null as class_hours,
  817. 4 as type
  818. FROM
  819. course_menu_exam cme
  820. LEFT JOIN exam e ON cme.exam_id = e.exam_id
  821. WHERE 1=1
  822. and cme.module_id =0
  823. <if test="courseId != null and courseId !='' ">
  824. AND cme.course_id=#{courseId}
  825. </if>
  826. <if test="chapterId != null and chapterId !='' ">
  827. AND cme.chapter_id = #{chapterId}
  828. </if>
  829. </select>
  830. <select id="selectStart" parameterType="map" resultType="long">
  831. SELECT
  832. usr.create_time
  833. FROM
  834. user_study_record usr
  835. WHERE
  836. usr.goods_id = #{goodsId}
  837. AND usr.grade_id = #{gradeId}
  838. AND usr.user_id = #{userId} UNION
  839. SELECT
  840. ubr.create_time
  841. FROM
  842. user_bank_record ubr
  843. WHERE
  844. ubr.goods_id =#{goodsId}
  845. AND ubr.grade_id = #{gradeId}
  846. AND ubr.user_id = #{userId}
  847. ORDER BY create_time ASC
  848. </select>
  849. <select id="sendClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
  850. SELECT
  851. cgu.user_id,
  852. cg.class_start_time,
  853. cg.class_end_time,
  854. cgg.goods_id,
  855. cg.grade_id
  856. FROM
  857. class_grade_user cgu
  858. LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
  859. LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
  860. LEFT JOIN goods g on cgg.goods_id = g.goods_id
  861. LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
  862. where 1=1
  863. and irb.remind_id =5
  864. and cgu.status = 1
  865. AND unix_timestamp(now()) BETWEEN cg.class_end_time-1728000 and cg.class_end_time-1641600
  866. AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 5 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
  867. </select>
  868. <select id="sendTenClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
  869. SELECT
  870. cgu.user_id,
  871. cg.class_start_time,
  872. cg.class_end_time,
  873. cgg.goods_id,
  874. cg.grade_id
  875. FROM
  876. class_grade_user cgu
  877. LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
  878. LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
  879. LEFT JOIN goods g on cgg.goods_id = g.goods_id
  880. LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
  881. where 1=1
  882. and irb.remind_id =6
  883. and cgu.status = 1
  884. AND unix_timestamp(now()) BETWEEN cg.class_end_time-864000 and cg.class_end_time-777600
  885. AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 6 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
  886. </select>
  887. <select id="sendFiveClassGradeUser" resultMap="ClassGradeUserGoodsVoResult">
  888. SELECT
  889. cgu.user_id,
  890. cg.class_start_time,
  891. cg.class_end_time,
  892. cgg.goods_id,
  893. cg.grade_id
  894. FROM
  895. class_grade_user cgu
  896. LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
  897. LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
  898. LEFT JOIN goods g on cgg.goods_id = g.goods_id
  899. LEFT JOIN inform_remind_business irb on irb.business_id = g.business_id
  900. where 1=1
  901. and irb.remind_id =7
  902. and cgu.status = 1
  903. AND unix_timestamp(now()) BETWEEN cg.class_end_time-432000 and cg.class_end_time-345600
  904. AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 7 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
  905. </select>
  906. <select id="selectUserCount" parameterType="com.zhongzheng.modules.user.domain.User" resultType="long">
  907. SELECT
  908. COUNT( 1 )
  909. FROM
  910. `user`
  911. WHERE
  912. id_card = #{idCard} and user_id != #{userId} and `status` = 1
  913. </select>
  914. <select id="selectUserCertificate" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
  915. resultMap="ClassGradeUserVoResult">
  916. </select>
  917. <select id="findChapterList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="CourseChapterResultVo">
  918. SELECT
  919. cc.chapter_id,
  920. cc.`name`
  921. FROM
  922. course_module_chapter p
  923. LEFT JOIN course_chapter cc ON p.chapter_id = cc.chapter_id
  924. LEFT JOIN course_menu m ON m.menu_id = p.module_id
  925. LEFT JOIN goods_course gc ON gc.course_id = m.course_id
  926. WHERE
  927. gc.goods_id = #{goodsId}
  928. AND m.type IN ( 1 ) UNION
  929. SELECT
  930. cc.chapter_id,
  931. cc.`name`
  932. FROM
  933. course_menu m
  934. LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
  935. LEFT JOIN goods_course gc ON gc.course_id = m.course_id
  936. WHERE
  937. gc.goods_id = #{goodsId}
  938. AND m.type IN ( 2 )
  939. </select>
  940. <select id="selectOfficialInfoCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">
  941. SELECT
  942. count(*)
  943. FROM
  944. class_grade_user cgu
  945. WHERE
  946. cgu.grade_id = #{gradeId}
  947. AND cgu.official_status = 1
  948. </select>
  949. <select id="selectOfficialPeriodCount" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="long">
  950. SELECT
  951. count(*)
  952. FROM
  953. class_grade_user cgu
  954. WHERE
  955. cgu.grade_id = #{gradeId}
  956. AND cgu.period_plush = 1
  957. </select>
  958. </mapper>