| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="shop.alien.mapper.LawyerReconcMapper">
- <!-- 订单结果映射,包含律师信息 -->
- <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="problemScenarioId" />
- <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="alipay_no" property="alipayNo" />
- <result column="order_str" property="orderStr" />
- <result column="place_id" property="placeId" />
- <!-- 律师信息 -->
- <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="getOrderListWithLawyer" resultMap="OrderVOWithLawyerResultMap">
- SELECT
- lco.id,
- lco.order_number,
- lco.client_user_id,
- lco.lawyer_user_id,
- lco.problem_scenario_id,
- lco.problem_description,
- lco.order_amount,
- lco.consultation_fee,
- lco.start_time,
- lco.end_time,
- lco.order_status,
- lco.payment_status,
- lco.order_time,
- lco.payment_time,
- lco.validity_period,
- lco.rating,
- lco.comment,
- lco.created_time,
- lco.alipay_no,
- lco.order_str,
- lco.place_id,
- -- 律师信息
- lu.name AS lawyer_name,
- lu.phone AS lawyer_phone,
- lu.email AS lawyer_email,
- lu.lawyer_certificate_no,
- lu.law_firm,
- lu.practice_years,
- lu.specialty_fields,
- lu.certification_status,
- lu.service_score,
- lu.service_count,
- lu.consultation_fee AS lawyer_consultation_fee,
- lu.province,
- lu.city,
- lu.district,
- lu.address,
- lu.head_img,
- lu.nick_name,
- lu.personal_introduction
- FROM lawyer_consultation_order lco
- LEFT JOIN lawyer_user lu ON lco.lawyer_user_id = lu.id AND lu.delete_flag = 0
- WHERE lco.delete_flag = 0
- <if test="orderNumber != null and orderNumber != ''">
- AND lco.order_number LIKE CONCAT('%', #{orderNumber}, '%')
- </if>
- <if test="clientUserId != null">
- AND lco.client_user_id = #{clientUserId}
- </if>
- <if test="lawyerUserId != null">
- AND lco.lawyer_user_id = #{lawyerUserId}
- </if>
- <if test="lawyerName != null and lawyerName != ''">
- AND lu.name LIKE CONCAT('%', #{lawyerName}, '%')
- </if>
- <if test="orderStatus != null">
- AND lco.order_status = #{orderStatus}
- </if>
- <if test="paymentStatus != null">
- AND lco.payment_status = #{paymentStatus}
- </if>
- <if test="startTime != null and startTime != ''">
- AND lco.created_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND lco.created_time <= #{endTime}
- </if>
- ORDER BY lco.created_time DESC
- </select>
- <!-- 查询订单列表(不分页,关联律师信息) -->
- <select id="getOrderList" resultMap="OrderVOWithLawyerResultMap">
- SELECT
- lco.id,
- lco.order_number,
- lco.client_user_id,
- lco.lawyer_user_id,
- lco.problem_scenario_id,
- lco.problem_description,
- lco.order_amount,
- lco.consultation_fee,
- lco.start_time,
- lco.end_time,
- lco.order_status,
- lco.payment_status,
- lco.order_time,
- lco.payment_time,
- lco.validity_period,
- lco.rating,
- lco.comment,
- lco.created_time,
- lco.alipay_no,
- lco.order_str,
- lco.place_id,
- -- 律师信息
- lu.name AS lawyer_name,
- lu.phone AS lawyer_phone,
- lu.email AS lawyer_email,
- lu.lawyer_certificate_no,
- lu.law_firm,
- lu.practice_years,
- lu.specialty_fields,
- lu.certification_status,
- lu.service_score,
- lu.service_count,
- lu.consultation_fee AS lawyer_consultation_fee,
- lu.province,
- lu.city,
- lu.district,
- lu.address,
- lu.head_img,
- lu.nick_name,
- lu.personal_introduction
- FROM lawyer_consultation_order lco
- LEFT JOIN lawyer_user lu ON lco.lawyer_user_id = lu.id AND lu.delete_flag = 0
- WHERE lco.delete_flag = 0
- <if test="orderNumber != null and orderNumber != ''">
- AND lco.order_number LIKE CONCAT('%', #{orderNumber}, '%')
- </if>
- <if test="clientUserId != null">
- AND lco.client_user_id = #{clientUserId}
- </if>
- <if test="lawyerUserId != null">
- AND lco.lawyer_user_id = #{lawyerUserId}
- </if>
- <if test="lawyerName != null and lawyerName != ''">
- AND lu.name LIKE CONCAT('%', #{lawyerName}, '%')
- </if>
- <if test="orderStatus != null">
- AND lco.order_status = #{orderStatus}
- </if>
- <if test="paymentStatus != null">
- AND lco.payment_status = #{paymentStatus}
- </if>
- <if test="startTime != null and startTime != ''">
- AND lco.created_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND lco.created_time <= #{endTime}
- </if>
- ORDER BY lco.created_time DESC
- </select>
- </mapper>
|