CourseMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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.course.mapper.CourseMapper">
  6. <resultMap type="com.zhongzheng.modules.course.domain.Course" id="CourseResult">
  7. <result property="courseId" column="course_id"/>
  8. <result property="prefixName" column="prefix_name"/>
  9. <result property="coverUrl" column="cover_url"/>
  10. <result property="introduction" column="introduction"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="updateTime" column="update_time"/>
  13. <result property="status" column="status"/>
  14. <result property="educationTypeId" column="education_type_id"/>
  15. <result property="businessId" column="business_id"/>
  16. <result property="schoolId" column="school_id"/>
  17. <result property="courseName" column="course_name"/>
  18. <result property="publishStatus" column="publish_status"/>
  19. <result property="sort" column="sort"/>
  20. <result property="suitableObject" column="suitable_object"/>
  21. <result property="pcDetailHtml" column="pc_detail_html"/>
  22. <result property="mobileDetailHtml" column="mobile_detail_html"/>
  23. <result property="majorId" column="major_id"/>
  24. <result property="code" column="code"/>
  25. <result property="subjectId" column="subject_id"/>
  26. <result property="projectId" column="project_id"/>
  27. </resultMap>
  28. <resultMap type="com.zhongzheng.modules.course.vo.CourseVo" id="CourseResultVo">
  29. <result property="courseId" column="course_id"/>
  30. <result property="prefixName" column="prefix_name"/>
  31. <result property="coverUrl" column="cover_url"/>
  32. <result property="introduction" column="introduction"/>
  33. <result property="status" column="status"/>
  34. <result property="educationTypeId" column="education_type_id"/>
  35. <result property="businessId" column="business_id"/>
  36. <result property="schoolId" column="school_id"/>
  37. <result property="courseName" column="course_name"/>
  38. <result property="publishStatus" column="publish_status"/>
  39. <result property="sort" column="sort"/>
  40. <result property="suitableObject" column="suitable_object"/>
  41. <result property="pcDetailHtml" column="pc_detail_html"/>
  42. <result property="mobileDetailHtml" column="mobile_detail_html"/>
  43. <result property="majorId" column="major_id"/>
  44. <result property="code" column="code"/>
  45. <result property="subjectId" column="subject_id"/>
  46. <result property="projectId" column="project_id"/>
  47. <result property="createTime" column="create_time"/>
  48. <result property="updateTime" column="update_time"/>
  49. <result property="educationName" column="education_name"/>
  50. <result property="projectName" column="project_name"/>
  51. <result property="businessName" column="business_name"/>
  52. <result property="schoolName" column="school_name"/>
  53. <result property="categoryName" column="category_name"/>
  54. <result property="subjectName" column="subject_name"/>
  55. <collection property="goodsList" column="course_id" select="findGoodsList"/>
  56. </resultMap>
  57. <resultMap type="com.zhongzheng.modules.course.vo.CourseUserVo" id="CourseUserVo">
  58. <result property="courseId" column="course_id"/>
  59. <result property="prefixName" column="prefix_name"/>
  60. <result property="coverUrl" column="cover_url"/>
  61. <result property="gradeId" column="grade_id"/>
  62. <result property="introduction" column="introduction"/>
  63. <result property="status" column="status"/>
  64. <result property="educationTypeId" column="education_type_id"/>
  65. <result property="businessId" column="business_id"/>
  66. <result property="schoolId" column="school_id"/>
  67. <result property="courseName" column="course_name"/>
  68. <result property="publishStatus" column="publish_status"/>
  69. <result property="sort" column="sort"/>
  70. <result property="suitableObject" column="suitable_object"/>
  71. <result property="pcDetailHtml" column="pc_detail_html"/>
  72. <result property="mobileDetailHtml" column="mobile_detail_html"/>
  73. <result property="majorId" column="major_id"/>
  74. <result property="code" column="code"/>
  75. <result property="subjectId" column="subject_id"/>
  76. <result property="projectId" column="project_id"/>
  77. <result property="createTime" column="create_time"/>
  78. <result property="updateTime" column="update_time"/>
  79. <result property="educationName" column="education_name"/>
  80. <result property="projectName" column="project_name"/>
  81. <result property="businessName" column="business_name"/>
  82. <result property="schoolName" column="school_name"/>
  83. <result property="categoryName" column="category_name"/>
  84. <result property="subjectName" column="subject_name"/>
  85. </resultMap>
  86. <resultMap type="com.zhongzheng.modules.goods.vo.GoodsPeriodVo" id="GoodsPeriodVo">
  87. <result property="goodsId" column="goods_id"/>
  88. <result property="year" column="year"/>
  89. <result property="goodsName" column="goods_name"/>
  90. <result property="periodStatus" column="period_status"/>
  91. <result property="rebuild" column="rebuild"/>
  92. <result property="gradeId" column="grade_id"/>
  93. <result property="examNum" column="exam_num"/>
  94. <result property="recordNum" column="record_num"/>
  95. <result property="applyStatus" column="apply_status"/>
  96. <result property="beforeStatus" column="before_status"/>
  97. <result property="applyName" column="apply_name"/>
  98. <result property="beforeName" column="before_name"/>
  99. <result property="rebuildStatus" column="rebuild_status"/>
  100. </resultMap>
  101. <resultMap type="com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo" id="GoodsPeriodStatusVo">
  102. <result property="id" column="id"/>
  103. <result property="type" column="type"/>
  104. <result property="name" column="name"/>
  105. <result property="periodId" column="period_id"/>
  106. </resultMap>
  107. <resultMap type="com.zhongzheng.modules.goods.vo.GoodsUserVo" id="GoodsUserVo">
  108. <result property="goodsId" column="goods_id"/>
  109. <result property="year" column="year"/>
  110. <result property="supplyId" column="supply_id"/>
  111. <result property="userId" column="user_id"/>
  112. <result property="goodsType" column="goods_type"/>
  113. <result property="educationTypeId" column="education_type_id"/>
  114. <result property="businessId" column="business_id"/>
  115. <result property="schoolId" column="school_id"/>
  116. <result property="majorId" column="major_id"/>
  117. <result property="goodsName" column="goods_name"/>
  118. <result property="standPrice" column="stand_price"/>
  119. <result property="lowestPrice" column="lowest_price"/>
  120. <result property="createTime" column="create_time"/>
  121. <result property="updateTime" column="update_time"/>
  122. <result property="status" column="status"/>
  123. <result property="validityStartTime" column="validity_start_time"/>
  124. <result property="validityEndTime" column="validity_end_time"/>
  125. <result property="studyStartTime" column="study_start_time"/>
  126. <result property="studyEndTime" column="study_end_time"/>
  127. <result property="certificateIds" column="certificate_ids"/>
  128. <result property="introduce" column="introduce"/>
  129. <result property="suitableObject" column="suitable_object"/>
  130. <result property="buyNote" column="buy_note"/>
  131. <result property="pcDetailHtml" column="pc_detail_html"/>
  132. <result property="mobileDetailHtml" column="mobile_detail_html"/>
  133. <result property="goodsStatus" column="goods_status"/>
  134. <result property="coverUrl" column="cover_url"/>
  135. <result property="classHours" column="class_hours"/>
  136. <result property="standPriceJson" column="stand_price_json"/>
  137. <result property="code" column="code"/>
  138. <result property="projectId" column="project_id"/>
  139. <result property="goodsAuditionConfig" column="goods_audition_config"/>
  140. <result property="goodsPhotographConfig" column="goods_photograph_config"/>
  141. <result property="goodsPlayConfig" column="goods_play_config"/>
  142. <result property="goodsExamConfig" column="goods_exam_config"/>
  143. <result property="gradeId" column="grade_id"/>
  144. <result property="supplyName" column="supply_name"/>
  145. <result property="educationName" column="education_name"/>
  146. <result property="projectName" column="project_name"/>
  147. <result property="businessName" column="business_name"/>
  148. <result property="schoolName" column="school_name"/>
  149. <result property="categoryName" column="category_name"/>
  150. <result property="handoutsId" column="handouts_id"/>
  151. <result property="templateType" column="template_type"/>
  152. <result property="period" column="period"/>
  153. <result property="makeStartTime" column="make_start_time"/>
  154. <result property="makeEndTime" column="make_end_time"/>
  155. <result property="studyCount" column="study_count"/>
  156. <result property="makeGoodsName" column="make_goods_name"/>
  157. <result property="makeGoodsCode" column="make_goods_code"/>
  158. <result property="applyStatus" column="apply_status"/>
  159. <result property="beforeStatus" column="before_status"/>
  160. <result property="applyName" column="apply_name"/>
  161. <result property="beforeName" column="before_name"/>
  162. <result property="courseNum" column="course_num"/>
  163. </resultMap>
  164. <select id="findGoodsList" resultMap="CourseGoodsListResult">
  165. SELECT
  166. g.goods_name,
  167. g.goods_id
  168. FROM
  169. goods_course gc
  170. LEFT JOIN goods g ON gc.goods_id = g.goods_id
  171. WHERE
  172. gc.course_id =#{course_id}
  173. </select>
  174. <resultMap type="com.zhongzheng.modules.course.vo.CourseGoodsVo" id="CourseGoodsListResult">
  175. <result property="goodsName" column="goods_name"/>
  176. <result property="goodsId" column="goods_id"/>
  177. </resultMap>
  178. <select id="selectCourseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="CourseResultVo">
  179. SELECT
  180. c.*,
  181. cet.education_name,
  182. cpt.project_name,
  183. cb.business_name,
  184. s.school_name,
  185. m.category_name,
  186. cs.subject_name
  187. FROM
  188. course c
  189. LEFT JOIN course_education_type cet ON c.education_type_id = cet.id AND cet.status =1
  190. LEFT JOIN course_project_type cpt ON c.project_id = cpt.id AND cpt.status =1
  191. LEFT JOIN course_business cb ON c.business_id = cb.id AND cb.status =1
  192. LEFT JOIN school s ON s.id = c.school_id AND s.status =1
  193. LEFT JOIN major m ON c.major_id = m.id AND m.status =1
  194. LEFT JOIN course_subject cs ON cs.id = c.subject_id AND cs.status =1
  195. WHERE
  196. 1 = 1 AND c.status !=-1
  197. <if test="status != null and status.size()!=0 ">
  198. AND c.status in
  199. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  200. #{item}
  201. </foreach>
  202. </if>
  203. <if test="educationTypeId != null and educationTypeId != ''">
  204. AND c.education_type_id = #{educationTypeId}
  205. </if>
  206. <if test="subjectId != null and subjectId != ''">
  207. AND c.subject_id = #{subjectId}
  208. </if>
  209. <if test="businessId != null and businessId != ''">
  210. AND c.business_id = #{businessId}
  211. </if>
  212. <if test="prefixName != null and prefixName != ''">
  213. AND c.prefix_name like concat('%', #{prefixName}, '%')
  214. </if>
  215. <if test="courseName != null and courseName != ''">
  216. AND c.course_name like concat('%', #{courseName}, '%')
  217. </if>
  218. <if test="publishStatus != null ">
  219. AND c.publish_status = #{publishStatus}
  220. </if>
  221. <if test="schoolId != null and schoolId != ''">
  222. AND c.school_id = #{schoolId}
  223. </if>
  224. <if test="majorId != null and majorId != ''">
  225. AND c.major_id = #{majorId}
  226. </if>
  227. GROUP BY
  228. c.course_id
  229. ORDER BY c.course_id DESC
  230. </select>
  231. <select id="selectCourseList_COUNT" resultType="Long">
  232. SELECT
  233. count(distinct c.course_id )
  234. FROM
  235. course c
  236. WHERE
  237. 1 = 1
  238. <if test="status != null and status.size()!=0 ">
  239. AND c.status in
  240. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  241. #{item}
  242. </foreach>
  243. </if>
  244. <if test="educationTypeId != null and educationTypeId != ''">
  245. AND c.education_type_id = #{educationTypeId}
  246. </if>
  247. <if test="subjectId != null and subjectId != ''">
  248. AND c.subject_id = #{subjectId}
  249. </if>
  250. <if test="businessId != null and businessId != ''">
  251. AND c.business_id = #{businessId}
  252. </if>
  253. <if test="prefixName != null and prefixName != ''">
  254. AND c.prefix_name like concat('%', #{prefixName}, '%')
  255. </if>
  256. <if test="courseName != null and courseName != ''">
  257. AND c.course_name like concat('%', #{courseName}, '%')
  258. </if>
  259. <if test="publishStatus != null ">
  260. AND c.publish_status = #{publishStatus}
  261. </if>
  262. <if test="schoolId != null and schoolId != ''">
  263. AND c.school_id = #{schoolId}
  264. </if>
  265. <if test="majorId != null and majorId != ''">
  266. AND c.major_id = #{majorId}
  267. </if>
  268. </select>
  269. <select id="selectDetailById" parameterType="Long" resultMap="CourseResultVo">
  270. SELECT
  271. c.*,
  272. cet.education_name,
  273. cpt.project_name,
  274. cb.business_name,
  275. s.school_name,
  276. m.category_name,
  277. cs.subject_name
  278. FROM
  279. course c
  280. LEFT JOIN course_education_type cet ON c.education_type_id = cet.id
  281. LEFT JOIN course_project_type cpt ON c.project_id = cpt.id
  282. LEFT JOIN course_business cb ON c.business_id = cb.id
  283. LEFT JOIN school s ON s.id = c.school_id
  284. LEFT JOIN major m ON c.major_id = m.id
  285. LEFT JOIN course_subject cs ON cs.id = c.subject_id
  286. WHERE
  287. course_id = #{id}
  288. </select>
  289. <select id="getCourseUserVoInfo" parameterType="Long" resultMap="CourseUserVo">
  290. SELECT
  291. c.*,
  292. cet.education_name,
  293. cpt.project_name,
  294. cb.business_name,
  295. s.school_name,
  296. m.category_name,
  297. cs.subject_name
  298. FROM
  299. course c
  300. LEFT JOIN course_education_type cet ON c.education_type_id = cet.id
  301. LEFT JOIN course_project_type cpt ON c.project_id = cpt.id
  302. LEFT JOIN course_business cb ON c.business_id = cb.id
  303. LEFT JOIN school s ON s.id = c.school_id
  304. LEFT JOIN major m ON c.major_id = m.id
  305. LEFT JOIN course_subject cs ON cs.id = c.subject_id
  306. WHERE
  307. course_id = #{id}
  308. </select>
  309. <select id="listGoodsPeriodVo" parameterType="com.zhongzheng.modules.user.bo.UserPlanQueryBo" resultMap="GoodsPeriodVo">
  310. SELECT
  311. g.goods_id,
  312. g.goods_name,
  313. g.`year`,
  314. (SELECT COUNT(1) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where up.goods_id = g.goods_id AND ups.period_status =1 and ups.`status` =0 or ups.`status` =3) as rebuild,
  315. (case WHEN (SELECT COUNT(1) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where up.goods_id = g.goods_id AND ups.period_status =1 and ups.`status` =0) >0 then 0 ELSE 1 end) as rebuild_status,
  316. cgu.grade_id,
  317. (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN 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,
  318. (SELECT COUNT(DISTINCT ubr.record_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id = ubr.goods_id where ubr.`status`=1 and ubr.type =2 and ubr.report_status =1 and ubr.user_id =cgu.user_id and ubr.grade_id = cg.grade_id) as record_num,
  319. (SELECT COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
  320. ups.`status` =1 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 1) as pass,
  321. (SELECT
  322. COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
  323. =0 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 1) as cheat,
  324. (SELECT COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
  325. ups.`status` =1 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 2) as exam_pass,
  326. (SELECT
  327. COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
  328. =0 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 2) as exam_cheat,
  329. (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
  330. (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,
  331. (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) as apply_name,
  332. (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name
  333. FROM
  334. class_grade_user cgu
  335. LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
  336. LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
  337. LEFT JOIN goods g on g.goods_id=cgg.goods_id
  338. WHERE
  339. cgu.user_id =#{userId}
  340. and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time
  341. AND cg.status=1
  342. </select>
  343. <select id="listSection" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="GoodsPeriodStatusVo">
  344. SELECT
  345. ups.id,
  346. ups.period_id,
  347. cs.`name`,
  348. 1 as type
  349. FROM
  350. user_period up
  351. LEFT JOIN user_period_status ups ON up.id = ups.period_id
  352. LEFT JOIN course_section cs ON cs.section_id = up.section_id
  353. WHERE
  354. 1 = 1
  355. AND user_id = #{userId}
  356. AND ups.period_status = 1
  357. AND ups.`status` = 0
  358. AND up.exam_id = 0
  359. and up.grade_id = #{gradeId}
  360. UNION
  361. SELECT
  362. ups.id,
  363. ups.period_id,
  364. exam_name as name,
  365. 2 as type
  366. FROM
  367. user_period up
  368. LEFT JOIN user_period_status ups ON up.id = ups.period_id
  369. LEFT JOIN exam e ON e.exam_id = up.exam_id
  370. WHERE
  371. 1 = 1
  372. AND user_id = #{userId}
  373. AND ups.period_status = 1
  374. AND ups.`status` = 0
  375. AND up.section_id = 0
  376. and up.grade_id = #{gradeId}
  377. </select>
  378. <select id="goodsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="GoodsUserVo">
  379. SELECT
  380. g.*,
  381. cgu.grade_id,
  382. cgu.user_id,
  383. (SELECT COUNT(1) FROM goods_course gc where gc.goods_id = g.goods_id) as course_num,
  384. (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
  385. (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,
  386. (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) as apply_name,
  387. (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name
  388. FROM
  389. class_grade_user cgu
  390. LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
  391. LEFT JOIN goods g on cgg.goods_id = g.goods_id
  392. LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
  393. where 1=1
  394. <if test="userId != null and userId != ''">
  395. and cgu.user_id = #{userId}
  396. </if>
  397. and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time
  398. and cg.status =1
  399. and cgu.status =1
  400. </select>
  401. <select id="courseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="CourseUserVo">
  402. SELECT
  403. c.*,
  404. #{gradeId} as grade_id
  405. FROM
  406. course c
  407. LEFT JOIN goods_course gc ON gc.course_id = c.course_id
  408. where 1=1
  409. and gc.goods_id =#{goodsId}
  410. </select>
  411. <select id="rebuildNext" parameterType="Long" resultType="Long">
  412. SELECT
  413. COUNT( 1 )
  414. FROM
  415. user_period up
  416. LEFT JOIN user_period_status ups ON up.id = ups.period_id
  417. WHERE
  418. up.goods_id = #{goodsId}
  419. AND up.grade_id = #{gradeId}
  420. AND ups.`status` = 0
  421. AND ups.period_status = 1
  422. </select>
  423. </mapper>