LawyerReconcMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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="shop.alien.mapper.LawyerReconcMapper">
  4. <!-- 订单结果映射,包含律师信息 -->
  5. <resultMap id="OrderVOWithLawyerResultMap" type="shop.alien.entity.store.vo.LawyerConsultationOrderVO">
  6. <!-- 订单基本信息 -->
  7. <id column="id" property="id" />
  8. <result column="order_number" property="orderNumber" />
  9. <result column="client_user_id" property="clientUserId" />
  10. <result column="lawyer_user_id" property="lawyerUserId" />
  11. <result column="problem_scenario_id" property="problemScenarioId" />
  12. <result column="problem_description" property="problemDescription" />
  13. <result column="order_amount" property="orderAmount" />
  14. <result column="consultation_fee" property="consultationFee" />
  15. <result column="start_time" property="startTime" />
  16. <result column="end_time" property="endTime" />
  17. <result column="order_status" property="orderStatus" />
  18. <result column="payment_status" property="paymentStatus" />
  19. <result column="order_time" property="orderTime" />
  20. <result column="payment_time" property="paymentTime" />
  21. <result column="validity_period" property="validityPeriod" />
  22. <result column="rating" property="rating" />
  23. <result column="comment" property="comment" />
  24. <result column="created_time" property="createdTime" />
  25. <result column="alipay_no" property="alipayNo" />
  26. <result column="order_str" property="orderStr" />
  27. <result column="place_id" property="placeId" />
  28. <!-- 律师信息 -->
  29. <result column="lawyer_name" property="lawyerName" />
  30. <result column="lawyer_phone" property="lawyerPhone" />
  31. <result column="lawyer_email" property="lawyerEmail" />
  32. <result column="lawyer_certificate_no" property="lawyerCertificateNo" />
  33. <result column="law_firm" property="lawFirm" />
  34. <result column="practice_years" property="practiceYears" />
  35. <result column="specialty_fields" property="specialtyFields" />
  36. <result column="certification_status" property="certificationStatus" />
  37. <result column="service_score" property="serviceScore" />
  38. <result column="service_count" property="serviceCount" />
  39. <result column="lawyer_consultation_fee" property="lawyerConsultationFee" />
  40. <result column="province" property="province" />
  41. <result column="city" property="city" />
  42. <result column="district" property="district" />
  43. <result column="address" property="address" />
  44. <result column="head_img" property="headImg" />
  45. <result column="nick_name" property="nickName" />
  46. <result column="personal_introduction" property="personalIntroduction" />
  47. </resultMap>
  48. <!-- 查询订单列表(分页,关联律师信息)-->
  49. <select id="getOrderListWithLawyer" resultMap="OrderVOWithLawyerResultMap">
  50. SELECT
  51. lco.id,
  52. lco.order_number,
  53. lco.client_user_id,
  54. lco.lawyer_user_id,
  55. lco.problem_scenario_id,
  56. lco.problem_description,
  57. lco.order_amount,
  58. lco.consultation_fee,
  59. lco.start_time,
  60. lco.end_time,
  61. lco.order_status,
  62. lco.payment_status,
  63. lco.order_time,
  64. lco.payment_time,
  65. lco.validity_period,
  66. lco.rating,
  67. lco.comment,
  68. lco.created_time,
  69. lco.alipay_no,
  70. lco.order_str,
  71. lco.place_id,
  72. -- 律师信息
  73. lu.name AS lawyer_name,
  74. lu.phone AS lawyer_phone,
  75. lu.email AS lawyer_email,
  76. lu.lawyer_certificate_no,
  77. lu.law_firm,
  78. lu.practice_years,
  79. lu.specialty_fields,
  80. lu.certification_status,
  81. lu.service_score,
  82. lu.service_count,
  83. lu.consultation_fee AS lawyer_consultation_fee,
  84. lu.province,
  85. lu.city,
  86. lu.district,
  87. lu.address,
  88. lu.head_img,
  89. lu.nick_name,
  90. lu.personal_introduction
  91. FROM lawyer_consultation_order lco
  92. LEFT JOIN lawyer_user lu ON lco.lawyer_user_id = lu.id AND lu.delete_flag = 0
  93. WHERE lco.delete_flag = 0
  94. <if test="orderNumber != null and orderNumber != ''">
  95. AND lco.order_number LIKE CONCAT('%', #{orderNumber}, '%')
  96. </if>
  97. <if test="clientUserId != null">
  98. AND lco.client_user_id = #{clientUserId}
  99. </if>
  100. <if test="lawyerUserId != null">
  101. AND lco.lawyer_user_id = #{lawyerUserId}
  102. </if>
  103. <if test="lawyerName != null and lawyerName != ''">
  104. AND lu.name LIKE CONCAT('%', #{lawyerName}, '%')
  105. </if>
  106. <if test="orderStatus != null">
  107. AND lco.order_status = #{orderStatus}
  108. </if>
  109. <if test="paymentStatus != null">
  110. AND lco.payment_status = #{paymentStatus}
  111. </if>
  112. <if test="startTime != null and startTime != ''">
  113. AND lco.created_time &gt;= #{startTime}
  114. </if>
  115. <if test="endTime != null and endTime != ''">
  116. AND lco.created_time &lt;= #{endTime}
  117. </if>
  118. ORDER BY lco.created_time DESC
  119. </select>
  120. <!-- 查询订单列表(不分页,关联律师信息) -->
  121. <select id="getOrderList" resultMap="OrderVOWithLawyerResultMap">
  122. SELECT
  123. lco.id,
  124. lco.order_number,
  125. lco.client_user_id,
  126. lco.lawyer_user_id,
  127. lco.problem_scenario_id,
  128. lco.problem_description,
  129. lco.order_amount,
  130. lco.consultation_fee,
  131. lco.start_time,
  132. lco.end_time,
  133. lco.order_status,
  134. lco.payment_status,
  135. lco.order_time,
  136. lco.payment_time,
  137. lco.validity_period,
  138. lco.rating,
  139. lco.comment,
  140. lco.created_time,
  141. lco.alipay_no,
  142. lco.order_str,
  143. lco.place_id,
  144. -- 律师信息
  145. lu.name AS lawyer_name,
  146. lu.phone AS lawyer_phone,
  147. lu.email AS lawyer_email,
  148. lu.lawyer_certificate_no,
  149. lu.law_firm,
  150. lu.practice_years,
  151. lu.specialty_fields,
  152. lu.certification_status,
  153. lu.service_score,
  154. lu.service_count,
  155. lu.consultation_fee AS lawyer_consultation_fee,
  156. lu.province,
  157. lu.city,
  158. lu.district,
  159. lu.address,
  160. lu.head_img,
  161. lu.nick_name,
  162. lu.personal_introduction
  163. FROM lawyer_consultation_order lco
  164. LEFT JOIN lawyer_user lu ON lco.lawyer_user_id = lu.id AND lu.delete_flag = 0
  165. WHERE lco.delete_flag = 0
  166. <if test="orderNumber != null and orderNumber != ''">
  167. AND lco.order_number LIKE CONCAT('%', #{orderNumber}, '%')
  168. </if>
  169. <if test="clientUserId != null">
  170. AND lco.client_user_id = #{clientUserId}
  171. </if>
  172. <if test="lawyerUserId != null">
  173. AND lco.lawyer_user_id = #{lawyerUserId}
  174. </if>
  175. <if test="lawyerName != null and lawyerName != ''">
  176. AND lu.name LIKE CONCAT('%', #{lawyerName}, '%')
  177. </if>
  178. <if test="orderStatus != null">
  179. AND lco.order_status = #{orderStatus}
  180. </if>
  181. <if test="paymentStatus != null">
  182. AND lco.payment_status = #{paymentStatus}
  183. </if>
  184. <if test="startTime != null and startTime != ''">
  185. AND lco.created_time &gt;= #{startTime}
  186. </if>
  187. <if test="endTime != null and endTime != ''">
  188. AND lco.created_time &lt;= #{endTime}
  189. </if>
  190. ORDER BY lco.created_time DESC
  191. </select>
  192. </mapper>