ExamActivityMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.top.settle.mapper.TopInstSettleMapper">
  6. <select id="getOrderInfo" parameterType="java.lang.String" resultType="com.zhongzheng.modules.top.settle.vo.TopOrderInfoVo">
  7. SELECT
  8. order_sn,
  9. create_no,
  10. create_username,
  11. purchase_org AS clientName,
  12. order_from,
  13. check_status
  14. FROM
  15. v_top_order
  16. WHERE
  17. order_sn = #{orderSn}
  18. </select>
  19. <select id="getOrderBusiness" parameterType="java.lang.String" resultType="java.lang.String">
  20. SELECT
  21. business_full_name
  22. FROM
  23. v_top_order_business
  24. WHERE
  25. order_sn = #{orderSn}
  26. </select>
  27. <select id="geTopCostBusinessName" parameterType="java.lang.Long" resultType="java.lang.String">
  28. SELECT CONCAT(( SELECT education_name FROM top_course_education_type WHERE id = ct.education_type_id ),
  29. ( SELECT business_name FROM top_course_business WHERE id = ct.business_id ),
  30. ( SELECT project_name FROM top_course_project_type WHERE id = ct.project_id )
  31. )
  32. FROM
  33. top_cost_inst_tp_item ct
  34. WHERE
  35. ct.id = #{id}
  36. </select>
  37. <select id="getGoodsBusinessNameList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessBo" resultType="java.lang.String">
  38. SELECT business_name FROM v_top_order_business WHERE 1=1
  39. <if test="orderSn != null and orderSn != ''">
  40. AND order_sn = #{orderSn}
  41. </if>
  42. <if test="orderGoodsId != null and orderGoodsId != ''">
  43. AND order_goods_id = #{orderGoodsId}
  44. </if>
  45. </select>
  46. <select id="getGoodsBusinessName" parameterType="map" resultType="java.lang.String">
  47. SELECT business_full_name FROM v_top_order_business WHERE order_goods_id = #{orderGoodsId} AND order_sn = #{orderSn}
  48. </select>
  49. <select id="getOrderGoodsByBusiness" parameterType="map" resultType="java.lang.Long">
  50. SELECT order_goods_id FROM v_top_order_business WHERE order_sn = #{orderSn} AND INSTR(business_full_name,#{tpBusinessName})
  51. </select>
  52. <select id="getSettleList" parameterType="com.zhongzheng.modules.top.settle.bo.SettleQueryBo" resultType="com.zhongzheng.modules.top.settle.vo.SettleVo">
  53. SELECT
  54. tis.settle_id,
  55. tis.settle_sn,
  56. tis.create_time,
  57. tis.title,
  58. tis.remark,
  59. tis.settle_type,
  60. tis.education_type_id,
  61. tis.project_id,
  62. tis.business_id,
  63. tis.settle_money,
  64. tis.create_user_id,
  65. tis.inst_id,
  66. ti.inst_name,
  67. ti.bank,
  68. ti.bank_name,
  69. ti.bank_account,
  70. tis.check_status,
  71. tis.`status`,
  72. tic.cost_cat_id,
  73. tic.category_name as costCatName,
  74. cet.education_name,
  75. CONCAT(cb.business_name,cpt.project_name) AS business_name
  76. FROM
  77. top_inst_settle tis
  78. LEFT JOIN top_course_education_type cet ON tis.education_type_id = cet.id
  79. LEFT JOIN top_course_project_type cpt ON tis.project_id = cpt.id
  80. LEFT JOIN top_course_business cb ON tis.business_id = cb.id
  81. LEFT JOIN top_institution ti ON tis.inst_id = ti.inst_id
  82. LEFT JOIN top_inst_category tic ON tis.cost_cat_id = tic.cost_cat_id
  83. WHERE
  84. tis.`status` != - 1
  85. <if test="settleType != null and settleType != ''">
  86. AND tis.settle_type = #{settleType}
  87. </if>
  88. <if test="costCatId != null and costCatId != ''">
  89. AND tis.cost_cat_id = #{costCatId}
  90. </if>
  91. <if test="educationTypeId != null and educationTypeId != ''">
  92. AND tis.education_type_id = #{educationTypeId}
  93. </if>
  94. <if test="businessId != null and businessId != ''">
  95. AND tis.business_id = #{businessId}
  96. </if>
  97. <if test="checkStatus != null and checkStatus != ''and checkStatus == 7">
  98. AND tis.check_status = 2
  99. AND ((SELECT tcl.role_id FROM top_old_order_check_log tcl
  100. WHERE tis.settle_sn = tcl.order_sn AND tcl.check_sign = 1 AND tcl.`status` = 1 LIMIT 1) IN
  101. <foreach collection="roleIds" item="item" index="index" open="(" close=")" separator=",">
  102. #{item}
  103. </foreach>)
  104. </if>
  105. <if test="checkStatus != null and checkStatus != '' and checkStatus != 7">
  106. AND tis.check_status = #{checkStatus}
  107. </if>
  108. <if test="startTime != null and startTime != ''">
  109. AND tis.create_time &gt;= #{startTime}
  110. </if>
  111. <if test="endTime != null and endTime != ''">
  112. AND tis.create_time &lt;= #{endTime}
  113. </if>
  114. <if test="title != null and title != ''">
  115. AND tis.title LIKE concat('%', #{title}, '%')
  116. </if>
  117. ORDER BY tis.create_time DESC
  118. </select>
  119. <select id="getSettleByBusiness" parameterType="map" resultType="com.zhongzheng.modules.top.settle.domian.TopInstSettle">
  120. SELECT
  121. tis.*
  122. FROM
  123. top_inst_settle tis
  124. LEFT JOIN top_course_education_type cet ON tis.education_type_id = cet.id
  125. LEFT JOIN top_course_project_type cpt ON tis.project_id = cpt.id
  126. LEFT JOIN top_course_business cb ON tis.business_id = cb.id
  127. WHERE
  128. tis.`status` = 1
  129. AND tis.check_status = 6
  130. AND settle_type = 2
  131. AND tis.sign_start_time &lt;= #{signTime} AND tis.sign_end_time &gt;= #{signTime}
  132. AND INSTR(
  133. #{businessName},
  134. CONCAT( cet.education_name, cb.business_name, cpt.project_name )) > 0
  135. AND (tis.settle_order_type = 3 OR tis.settle_order_type = #{settleOrderType})
  136. </select>
  137. </mapper>