|
|
@@ -4,16 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import shop.alien.entity.store.LawyerConsultationOrder;
|
|
|
import shop.alien.entity.store.vo.LawyerConsultationOrderVO;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
import shop.alien.entity.store.dto.LawyerConsultationOrderDto;
|
|
|
-import shop.alien.entity.store.vo.LifeCouponVo;
|
|
|
-import shop.alien.entity.store.vo.LifeUserExpertOrderVo;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -442,7 +437,17 @@ public interface LawyerConsultationOrderMapper extends BaseMapper<LawyerConsulta
|
|
|
" lur.user_phone client_user_phone,\n" +
|
|
|
" lco.order_amount - lco.consultation_fee as lawyerEarnings\n" +
|
|
|
" FROM lawyer_consultation_order lco\n" +
|
|
|
- " LEFT JOIN lawyer_user_violation luv ON luv.order_number = lco.order_number and luv.delete_flag = 0\n" +
|
|
|
+ " LEFT JOIN (\n" +
|
|
|
+ " SELECT luv1.*\n" +
|
|
|
+ " FROM lawyer_user_violation luv1\n" +
|
|
|
+ " INNER JOIN (\n" +
|
|
|
+ " SELECT order_number, MAX(id) as max_id\n" +
|
|
|
+ " FROM lawyer_user_violation\n" +
|
|
|
+ " WHERE delete_flag = 0\n" +
|
|
|
+ " GROUP BY order_number\n" +
|
|
|
+ " ) luv2 ON luv1.order_number = luv2.order_number AND luv1.id = luv2.max_id\n" +
|
|
|
+ " WHERE luv1.delete_flag = 0\n" +
|
|
|
+ " ) luv ON luv.order_number = lco.order_number\n" +
|
|
|
" LEFT JOIN lawyer_user lu ON lco.lawyer_user_id = lu.id AND lu.delete_flag = 0\n" +
|
|
|
" LEFT JOIN law_firm lf on lf.id = lu.firm_id\n" +
|
|
|
" left join lawyer_expertise_area lea on lea.id = lu.lawyer_expertise_area_id and lea.delete_flag = 0 " +
|