|
|
@@ -36,5 +36,114 @@
|
|
|
created_user_id, updated_time, updated_user_id
|
|
|
</sql>
|
|
|
|
|
|
+ <!-- 訂單VO結果映射,包含律師信息 -->
|
|
|
+ <resultMap id="OrderVOWithLawyerResultMap" type="shop.alien.entity.store.vo.LawyerConsultationOrderVO">
|
|
|
+ <!-- 訂單基本信息 -->
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="order_number" property="orderNumber" />
|
|
|
+ <result column="client_user_id" property="clientUserId" />
|
|
|
+ <result column="lawyer_user_id" property="lawyerUserId" />
|
|
|
+ <result column="problem_scenario_id" property="problemScenarId" />
|
|
|
+ <result column="problem_description" property="problemDescription" />
|
|
|
+ <result column="order_amount" property="orderAmount" />
|
|
|
+ <result column="consultation_fee" property="consultationFee" />
|
|
|
+ <result column="start_time" property="startTime" />
|
|
|
+ <result column="end_time" property="endTime" />
|
|
|
+ <result column="order_status" property="orderStatus" />
|
|
|
+ <result column="payment_status" property="paymentStatus" />
|
|
|
+ <result column="order_time" property="orderTime" />
|
|
|
+ <result column="payment_time" property="paymentTime" />
|
|
|
+ <result column="validity_period" property="validityPeriod" />
|
|
|
+ <result column="rating" property="rating" />
|
|
|
+ <result column="comment" property="comment" />
|
|
|
+ <result column="created_time" property="createdTime" />
|
|
|
+ <!-- 律師信息 -->
|
|
|
+ <result column="lawyer_name" property="lawyerName" />
|
|
|
+ <result column="lawyer_phone" property="lawyerPhone" />
|
|
|
+ <result column="lawyer_email" property="lawyerEmail" />
|
|
|
+ <result column="lawyer_certificate_no" property="lawyerCertificateNo" />
|
|
|
+ <result column="law_firm" property="lawFirm" />
|
|
|
+ <result column="practice_years" property="practiceYears" />
|
|
|
+ <result column="specialty_fields" property="specialtyFields" />
|
|
|
+ <result column="certification_status" property="certificationStatus" />
|
|
|
+ <result column="service_score" property="serviceScore" />
|
|
|
+ <result column="service_count" property="serviceCount" />
|
|
|
+ <result column="lawyer_consultation_fee" property="lawyerConsultationFee" />
|
|
|
+ <result column="province" property="province" />
|
|
|
+ <result column="city" property="city" />
|
|
|
+ <result column="district" property="district" />
|
|
|
+ <result column="address" property="address" />
|
|
|
+ <result column="head_img" property="headImg" />
|
|
|
+ <result column="nick_name" property="nickName" />
|
|
|
+ <result column="personal_introduction" property="personalIntroduction" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 分頁查詢訂單列表,聯查律師信息 -->
|
|
|
+ <select id="getConsultationOrderListWithLawyer" resultMap="OrderVOWithLawyerResultMap">
|
|
|
+ SELECT
|
|
|
+ o.id,
|
|
|
+ o.order_number,
|
|
|
+ o.client_user_id,
|
|
|
+ o.lawyer_user_id,
|
|
|
+ o.problem_scenario_id,
|
|
|
+ o.problem_description,
|
|
|
+ o.order_amount,
|
|
|
+ o.consultation_fee,
|
|
|
+ o.start_time,
|
|
|
+ o.end_time,
|
|
|
+ o.order_status,
|
|
|
+ o.payment_status,
|
|
|
+ o.order_time,
|
|
|
+ o.payment_time,
|
|
|
+ o.validity_period,
|
|
|
+ o.rating,
|
|
|
+ o.comment,
|
|
|
+ o.created_time,
|
|
|
+ -- 律師信息
|
|
|
+ l.name AS lawyer_name,
|
|
|
+ l.phone AS lawyer_phone,
|
|
|
+ l.email AS lawyer_email,
|
|
|
+ l.lawyer_certificate_no,
|
|
|
+ l.law_firm,
|
|
|
+ l.practice_years,
|
|
|
+ l.specialty_fields,
|
|
|
+ l.certification_status,
|
|
|
+ l.service_score,
|
|
|
+ l.service_count,
|
|
|
+ l.consultation_fee AS lawyer_consultation_fee,
|
|
|
+ l.province,
|
|
|
+ l.city,
|
|
|
+ l.district,
|
|
|
+ l.address,
|
|
|
+ l.head_img,
|
|
|
+ l.nick_name,
|
|
|
+ l.personal_introduction
|
|
|
+ FROM lawyer_consultation_order o
|
|
|
+ LEFT JOIN lawyer_user l ON o.lawyer_user_id = l.id AND l.delete_flag = 0
|
|
|
+ WHERE o.delete_flag = 0
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">
|
|
|
+ AND o.order_number = #{orderNumber}
|
|
|
+ </if>
|
|
|
+ <if test="clientUserId != null">
|
|
|
+ AND o.client_user_id = #{clientUserId}
|
|
|
+ </if>
|
|
|
+ <if test="lawyerUserId != null">
|
|
|
+ AND o.lawyer_user_id = #{lawyerUserId}
|
|
|
+ </if>
|
|
|
+ <if test="lawyerUserIds != null and lawyerUserIds.size() > 0">
|
|
|
+ AND o.lawyer_user_id IN
|
|
|
+ <foreach collection="lawyerUserIds" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="lawyerName != null and lawyerName != '' and (lawyerUserIds == null or lawyerUserIds.size() == 0)">
|
|
|
+ AND l.name LIKE CONCAT('%', #{lawyerName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ AND o.order_status = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ ORDER BY o.created_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|
|
|
|