KmtQuestionMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ssj.service.mapper.KmtQuestionMapper">
  4. <update id="updateEsLoadStatus">
  5. update kmt_question_know set es_loaded = #{newEsLoaded}
  6. where id in
  7. <foreach collection="kmtQuestionKnowIdList" open="(" item="kmtQuestionKnowId" separator="," close=")">
  8. #{kmtQuestionKnowId}
  9. </foreach>
  10. </update>
  11. <select id="findTrainRecommendQuestion" resultType="java.util.Map">
  12. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.easy difficulty
  13. from kmt_question,
  14. kmt_question_know
  15. where kmt_question.id = kmt_question_know.question_id
  16. and kmt_question_know.how_details_id in
  17. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  18. #{howDetailsId}
  19. </foreach>
  20. <if test="excludeQuestionIdSet.size() > 0">
  21. and kmt_question.id not in
  22. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  23. #{questionId}
  24. </foreach>
  25. </if>
  26. and kmt_question.easy = 1
  27. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  28. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  29. (ifnull(length(kmt_question.parent_id), 0) > 0))
  30. group by kmt_question.id
  31. order by rand()
  32. <if test="type == 1">
  33. limit 2
  34. </if>
  35. <if test="type == 2">
  36. limit 1
  37. </if>
  38. )
  39. union all
  40. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.easy difficulty
  41. from kmt_question,
  42. kmt_question_know
  43. where kmt_question.id = kmt_question_know.question_id
  44. and kmt_question_know.how_details_id in
  45. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  46. #{howDetailsId}
  47. </foreach>
  48. <if test="excludeQuestionIdSet.size() > 0">
  49. and kmt_question.id not in
  50. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  51. #{questionId}
  52. </foreach>
  53. </if>
  54. and kmt_question.easy = 2
  55. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  56. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  57. (ifnull(length(kmt_question.parent_id), 0) > 0))
  58. group by kmt_question.id
  59. order by rand()
  60. limit 1)
  61. <if test="type == 2">
  62. union all
  63. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.easy difficulty
  64. from kmt_question,
  65. kmt_question_know
  66. where kmt_question.id = kmt_question_know.question_id
  67. and kmt_question_know.how_details_id in
  68. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  69. #{howDetailsId}
  70. </foreach>
  71. <if test="excludeQuestionIdSet.size() > 0">
  72. and kmt_question.id not in
  73. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  74. #{questionId}
  75. </foreach>
  76. </if>
  77. and kmt_question.easy = 3
  78. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  79. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  80. (ifnull(length(kmt_question.parent_id), 0) > 0))
  81. group by kmt_question.id
  82. order by rand()
  83. limit 1)
  84. </if>
  85. </select>
  86. <select id="findFullQuestion" resultType="java.util.Map">
  87. select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.option_content, kmt_question.easy difficulty
  88. from kmt_question
  89. where kmt_question.id = #{parentId}
  90. or kmt_question.parent_id = #{parentId}
  91. order by kmt_question.num
  92. </select>
  93. <select id="countTrainRecommendQuestionV2" resultType="java.util.Map">
  94. <if test="recommendNumMap.easyNum > 0">
  95. (select count(distinct kmt_question.id) easy_num, 0 middle_num, 0 difficult_num
  96. from kmt_question,
  97. kmt_question_know
  98. where kmt_question.id = kmt_question_know.question_id
  99. and kmt_question_know.how_details_id in
  100. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  101. #{howDetailsId}
  102. </foreach>
  103. <if test="excludeQuestionIdSet.size() > 0">
  104. and kmt_question.id not in
  105. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  106. #{questionId}
  107. </foreach>
  108. </if>
  109. and kmt_question.easy = 1
  110. and kmt_question.state = 1
  111. and kmt_question.type = #{recommendNumMap.type}
  112. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  113. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  114. (ifnull(length(kmt_question.parent_id), 0) > 0))
  115. )
  116. </if>
  117. <if test="recommendNumMap.middleNum > 0">
  118. <if test="recommendNumMap.easyNum > 0">
  119. union all
  120. </if>
  121. (select 0 easy_num, count(distinct kmt_question.id) middle_num, 0 difficult_num
  122. from kmt_question,
  123. kmt_question_know
  124. where kmt_question.id = kmt_question_know.question_id
  125. and kmt_question_know.how_details_id in
  126. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  127. #{howDetailsId}
  128. </foreach>
  129. <if test="excludeQuestionIdSet.size() > 0">
  130. and kmt_question.id not in
  131. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  132. #{questionId}
  133. </foreach>
  134. </if>
  135. and kmt_question.easy = 2
  136. and kmt_question.state = 1
  137. and kmt_question.type = #{recommendNumMap.type}
  138. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  139. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  140. (ifnull(length(kmt_question.parent_id), 0) > 0)))
  141. </if>
  142. <if test="recommendNumMap.difficultNum > 0">
  143. <if test="recommendNumMap.easyNum > 0 or recommendNumMap.middleNum > 0">
  144. union all
  145. </if>
  146. (select 0 easy_num, 0 middle_num, count(distinct kmt_question.id) difficult_num
  147. from kmt_question,
  148. kmt_question_know
  149. where kmt_question.id = kmt_question_know.question_id
  150. and kmt_question_know.how_details_id in
  151. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  152. #{howDetailsId}
  153. </foreach>
  154. <if test="excludeQuestionIdSet.size() > 0">
  155. and kmt_question.id not in
  156. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  157. #{questionId}
  158. </foreach>
  159. </if>
  160. and kmt_question.easy = 3
  161. and kmt_question.state = 1
  162. and kmt_question.type = #{recommendNumMap.type}
  163. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  164. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  165. (ifnull(length(kmt_question.parent_id), 0) > 0)))
  166. </if>
  167. </select>
  168. <select id="findTrainRecommendQuestionV2" resultType="java.util.Map">
  169. <if test="recommendNumMap.easyLimitOffset > -1 and recommendNumMap.easyNum > 0">
  170. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.option_content, kmt_question.easy difficulty, kmt_question.option_type option_type_int
  171. from kmt_question,
  172. kmt_question_know
  173. where kmt_question.id = kmt_question_know.question_id
  174. and kmt_question_know.how_details_id in
  175. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  176. #{howDetailsId}
  177. </foreach>
  178. <if test="excludeQuestionIdSet.size() > 0">
  179. and kmt_question.id not in
  180. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  181. #{questionId}
  182. </foreach>
  183. </if>
  184. and kmt_question.state = 1
  185. and kmt_question.easy = 1
  186. and kmt_question.type = #{recommendNumMap.type}
  187. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  188. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  189. (ifnull(length(kmt_question.parent_id), 0) > 0))
  190. limit #{recommendNumMap.easyLimitOffset}, #{recommendNumMap.easyNum}
  191. )
  192. </if>
  193. <if test="recommendNumMap.middleLimitOffset > -1 and recommendNumMap.middleNum > 0">
  194. <if test="recommendNumMap.easyLimitOffset > -1">
  195. union all
  196. </if>
  197. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.option_content, kmt_question.easy difficulty, kmt_question.option_type option_type_int
  198. from kmt_question,
  199. kmt_question_know
  200. where kmt_question.id = kmt_question_know.question_id
  201. and kmt_question_know.how_details_id in
  202. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  203. #{howDetailsId}
  204. </foreach>
  205. <if test="excludeQuestionIdSet.size() > 0">
  206. and kmt_question.id not in
  207. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  208. #{questionId}
  209. </foreach>
  210. </if>
  211. and kmt_question.state = 1
  212. and kmt_question.easy = 2
  213. and kmt_question.type = #{recommendNumMap.type}
  214. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  215. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  216. (ifnull(length(kmt_question.parent_id), 0) > 0))
  217. limit #{recommendNumMap.middleLimitOffset}, #{recommendNumMap.middleNum})
  218. </if>
  219. <if test="recommendNumMap.difficultLimitOffset > -1 and recommendNumMap.difficultNum > 0">
  220. <if test="recommendNumMap.easyLimitOffset > -1 or recommendNumMap.middleLimitOffset > -1">
  221. union all
  222. </if>
  223. (select kmt_question.id, kmt_question.parent_id, kmt_question.question, kmt_question.option_content, kmt_question.easy difficulty, kmt_question.option_type option_type_int
  224. from kmt_question,
  225. kmt_question_know
  226. where kmt_question.id = kmt_question_know.question_id
  227. and kmt_question_know.how_details_id in
  228. <foreach collection="knowHowDetailIdSet" open="(" item="howDetailsId" separator="," close=")">
  229. #{howDetailsId}
  230. </foreach>
  231. <if test="excludeQuestionIdSet.size() > 0">
  232. and kmt_question.id not in
  233. <foreach collection="excludeQuestionIdSet" open="(" item="questionId" separator="," close=")">
  234. #{questionId}
  235. </foreach>
  236. </if>
  237. and kmt_question.state = 1
  238. and kmt_question.easy = 3
  239. and kmt_question.type = #{recommendNumMap.type}
  240. and ((1 > ifnull(length(kmt_question.parent_id), 0)
  241. and not exists(select id from kmt_question temp where kmt_question.id = temp.parent_id)) or
  242. (ifnull(length(kmt_question.parent_id), 0) > 0))
  243. limit #{recommendNumMap.difficultLimitOffset}, #{recommendNumMap.difficultNum})
  244. </if>
  245. </select>
  246. <!--查询知识点对应的题目,知识点命中数量越多,排序越靠前-->
  247. <select id="findQuestionByHowDetailIds" resultType="com.ssj.bean.conch.conch.dto.KmtQuestionDto">
  248. select q.id question_id, q.analysis, q.question, count(qk.how_details_id) num, q.question_class_type, q.parent_id from kmt_quality_question_know qk
  249. left join kmt_quality_questions q on qk.question_id=q.id where qk.how_details_id in
  250. <foreach collection="howDetailIds" open="(" item="id" separator="," close=")">
  251. #{id}
  252. </foreach>
  253. and q.deal_status = 4
  254. and q.question_class_type in (0, 2)
  255. group by q.id
  256. order by num desc limit #{count}
  257. </select>
  258. <!--查询题目列表-->
  259. <select id="findQuestionByIds" resultType="com.ssj.bean.conch.conch.dto.KmtQuestionDto">
  260. select q.id question_id, q.analysis, q.question from kmt_quality_questions q where id in
  261. <foreach collection="list" open="(" item="id" separator="," close=")">
  262. #{id}
  263. </foreach>
  264. </select>
  265. <select id="findWrongQuestionKnowModuleList" resultType="java.lang.String">
  266. select distinct
  267. <if test="subject == '语文' || subject == '数学'">
  268. t1.two_module
  269. </if>
  270. <if test="subject == '英语'">
  271. t1.module
  272. </if>
  273. from
  274. scon_homework k1 join
  275. scon_homework_how_details s1 on k1.subject = #{subject} and s1.is_wrong_ques_delete = 0 and s1.detail_count > 0
  276. and s1.homework_id = k1.id
  277. join zyb_know_how_details_sort t1 on t1.stat = 2 and t1.how_details_id = s1.how_detail_id
  278. where t1.type = s1.knowledge_version
  279. and s1.is_wrong_ques_delete = 0
  280. and s1.detail_count > 0
  281. <if test="type == 2">
  282. and s1.wrong_question_id is not null
  283. </if>
  284. and k1.vip_id = #{vipId}
  285. and k1.subject = #{subject}
  286. <if test="beginDateTimeStr != ''">
  287. and k1.create_time > #{beginDateTimeStr}
  288. </if>
  289. <if test="endDateTimeStr != ''">
  290. and #{endDateTimeStr} > k1.create_time
  291. </if>
  292. </select>
  293. <select id="findWrongQuestionKnowledgePage" resultType="com.ssj.service.conch.parents.v2.dto.WrongBookKnowledgeDTO2">
  294. select group_concat(s1.how_detail_id) know_how_detail_id_str,
  295. t1.alias knowledge_alias,
  296. count(distinct e1.id) wrong_question_sum,
  297. group_concat(t1.type) knowledge_version_str,
  298. 1 questionStatus
  299. from zyb_know_how_details_sort t1
  300. join scon_homework_how_details s1 on t1.stat = 2 and t1.how_details_id = s1.how_detail_id
  301. join scon_homework_picture e1 on s1.homework_picture_id = e1.id and e1.subject = #{subject}
  302. where s1.is_wrong_ques_delete = 0
  303. and s1.detail_count > 0
  304. and t1.type = s1.knowledge_version
  305. <if test="subject == '语文' || subject == '数学'">
  306. and t1.two_module = #{module}
  307. </if>
  308. <if test="subject == '英语'">
  309. and t1.module = #{module}
  310. </if>
  311. and e1.vip_id = #{vipId}
  312. <if test="beginDateTimeStr != ''">
  313. and e1.create_time > #{beginDateTimeStr}
  314. </if>
  315. <if test="endDateTimeStr != ''">
  316. and #{endDateTimeStr} > e1.create_time
  317. </if>
  318. and e1.subject = #{subject}
  319. group by knowledge_alias
  320. </select>
  321. <select id="findWrongBookQuestionPage" resultType="com.ssj.service.conch.parents.v2.dto.WrongBookQuestionDTO">
  322. select temp.homework_id,
  323. temp.create_time,
  324. group_concat(temp.homework_picture_id) homework_picture_id_str,
  325. group_concat(temp.picture_url) picture_url_str
  326. from (
  327. <foreach collection="req.knowHowDetailList" item="knowHowDetail" separator=" union all ">
  328. (select scon_homework_picture.id homework_picture_id,
  329. scon_homework_picture.homework_id,
  330. date(scon_homework_picture.create_time) create_time,
  331. if(length(scon_homework_picture.corrected_picture_url) > 0,
  332. scon_homework_picture.corrected_picture_url,
  333. scon_homework_picture.file_key) picture_url
  334. from scon_homework_picture,
  335. scon_homework_how_details
  336. where scon_homework_picture.id = scon_homework_how_details.homework_picture_id
  337. <if test="!includeDeleted">
  338. and scon_homework_how_details.is_wrong_ques_delete = 0
  339. </if>
  340. and scon_homework_how_details.detail_count > 0
  341. <if test="req.type == 2">
  342. and scon_homework_how_details.wrong_question_id is not null
  343. </if>
  344. and scon_homework_picture.vip_id = #{req.vipId}
  345. <if test="beginDateTimeStr != ''">
  346. and scon_homework_picture.create_time > #{beginDateTimeStr}
  347. </if>
  348. <if test="endDateTimeStr != ''">
  349. and #{endDateTimeStr} > scon_homework_picture.create_time
  350. </if>
  351. and scon_homework_how_details.how_detail_id = #{knowHowDetail.knowHowDetailId}
  352. and scon_homework_how_details.knowledge_version = #{knowHowDetail.knowledgeVersion}
  353. group by create_time, scon_homework_how_details.homework_picture_id)
  354. </foreach>
  355. ) temp
  356. group by create_time, homework_id
  357. order by create_time desc, homework_id
  358. </select>
  359. <select id="findWrongQuestionKnowModuleListV2" resultType="java.util.Map">
  360. select
  361. <if test="subject == '语文' || subject == '数学'">
  362. zyb_know_how_details_sort.two_module real_module,
  363. </if>
  364. <if test="subject == '英语'">
  365. zyb_know_how_details_sort.module real_module,
  366. </if>
  367. group_concat(how_details_id) how_details_id_str,
  368. group_concat(type) version_str
  369. from zyb_know_how_details_sort,
  370. scon_homework_how_details,
  371. scon_homework
  372. where zyb_know_how_details_sort.stat = 2
  373. and zyb_know_how_details_sort.how_details_id = scon_homework_how_details.how_detail_id
  374. and zyb_know_how_details_sort.type = scon_homework_how_details.knowledge_version
  375. and scon_homework_how_details.is_wrong_ques_delete = 0
  376. and scon_homework_how_details.detail_count > 0
  377. and scon_homework_how_details.homework_id = scon_homework.id
  378. and scon_homework.vip_id = #{vipId}
  379. and scon_homework.subject = #{subject}
  380. <if test="beginDateTimeStr != ''">
  381. and scon_homework.create_time > #{beginDateTimeStr}
  382. </if>
  383. <if test="endDateTimeStr != ''">
  384. and #{endDateTimeStr} > scon_homework.create_time
  385. </if>
  386. group by real_module
  387. </select>
  388. <select id="findByHowDetailKdId" resultType="java.util.Map">
  389. select kmt_question.id,
  390. kmt_question.parent_id,
  391. kmt_question.question,
  392. kmt_question.option_content,
  393. kmt_question.easy difficulty,
  394. kmt_question.option_type
  395. from kmt_question,
  396. kmt_question_know
  397. where kmt_question.id = kmt_question_know.question_id
  398. and kmt_question_know.how_details_kd_id in
  399. <foreach collection="wrongQuestionHowDetailKdIdList" open="(" item="wrongQuestionHowDetailKdId" separator="," close=")">
  400. #{wrongQuestionHowDetailKdId}
  401. </foreach>
  402. <if test="existQuestionIdSet.size() > 0">
  403. and kmt_question_know.question_id not in
  404. <foreach collection="existQuestionIdSet" open="(" item="existQuestionId" separator="," close=")">
  405. #{existQuestionId}
  406. </foreach>
  407. </if>
  408. group by how_details_kd_id
  409. </select>
  410. <select id="findWrongQuestionKnowModuleListV3New" resultType="java.lang.String">
  411. select distinct
  412. <if test="subject == '语文' || subject == '数学'">
  413. scon_knowledge_wrong_question_count.two_module
  414. </if>
  415. <if test="subject == '英语'">
  416. scon_knowledge_wrong_question_count.module
  417. </if>
  418. from scon_knowledge_wrong_question_count
  419. where mastered = 0
  420. and vip_id = #{vipId}
  421. and subject = #{subject}
  422. <if test="type == 2">
  423. and question_status > 0
  424. </if>
  425. <if test="beginDateTimeStr != ''">
  426. and homework_time > #{beginDateTimeStr}
  427. </if>
  428. <if test="endDateTimeStr != ''">
  429. and #{endDateTimeStr} > homework_time
  430. </if>
  431. </select>
  432. <select id="findWrongQuestionKnowledgePageV4New"
  433. resultType="com.ssj.service.conch.parents.v2.dto.WrongBookKnowledgeDTO2">
  434. select knowledge_name knowledge_alias,
  435. sum(wrong_count) wrong_question_sum,
  436. group_concat(how_detail_id) know_how_detail_id_str,
  437. group_concat(knowledge_version) knowledge_version_str,
  438. group_concat(question_status) question_status_str
  439. from scon_knowledge_wrong_question_count
  440. where mastered = 0
  441. and vip_id = #{vipId}
  442. and subject = #{subject}
  443. <if test="type == 2">
  444. and question_status > 0
  445. </if>
  446. <if test="subject == '语文' || subject == '数学'">
  447. and two_module = #{module}
  448. </if>
  449. <if test="subject == '英语'">
  450. and module = #{module}
  451. </if>
  452. <if test="beginDateTimeStr != ''">
  453. and homework_time > #{beginDateTimeStr}
  454. </if>
  455. <if test="endDateTimeStr != ''">
  456. and #{endDateTimeStr} > homework_time
  457. </if>
  458. group by knowledge_name
  459. </select>
  460. <select id="findAll2Es" resultType="java.util.Map">
  461. select questionKnow.*,
  462. kmt_question.course_name,
  463. ifnull(parent_id, '') parent_id,
  464. question,
  465. option_content,
  466. option_answer,
  467. option_type,
  468. type,
  469. easy,
  470. explain_text,
  471. analysis,
  472. thinking,
  473. suggest,
  474. date_format(update_time, '%Y-%m-%dT%H:%i:%s.000Z') update_time,
  475. state,
  476. source,
  477. checkuser,
  478. skill,
  479. kmt_question.remarks,
  480. min_option_type,
  481. ifnull(kmt_question.num, 0) num,
  482. tag,
  483. adduser,
  484. adduser_id,
  485. source_name,
  486. is_copy
  487. from (select id,
  488. question_id,
  489. how_details_id,
  490. how_id,
  491. course_name,
  492. how_details_kd_id,
  493. tags,
  494. date_format(create_time, '%Y-%m-%dT%H:%i:%s.000Z') create_time,
  495. date_format(last_update_time, '%Y-%m-%dT%H:%i:%s.000Z') last_update_time,
  496. remarks
  497. from kmt_question_know
  498. where es_loaded = 0
  499. limit #{pageSize}) questionKnow
  500. join kmt_question on questionKnow.question_id = kmt_question.id
  501. </select>
  502. <!-- 查询kmt老师详情 -->
  503. <select id="findKmtTeacherDetails" resultType="com.ssj.service.kmt.exercisesys.dto.KmtTeacherDetailDto">
  504. select detail.id detail_id, detail.alias detail_name, detail.grade, detail.semester, detail.course_name, detail.type version_type,
  505. etd.total_count, etd.un_finish_count, etd.question_total_count, etd.question_unfinish_count, etd.rollback_question_count
  506. from kmt_exercise_teacher_datalist etd left join zyb_know_how_details_sort detail
  507. on etd.business_id=detail.id and detail.stat=2
  508. where 1=1
  509. and etd.teacher_id=#{userId}
  510. and etd.type = #{type}
  511. <if test="detailName != null and detailName != ''">
  512. and detail.alias regexp #{detailName}
  513. </if>
  514. order by etd.un_finish_count desc, etd.id
  515. </select>
  516. </mapper>