package com.doumee.dao.business; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.doumee.dao.business.model.GoodsorderDetail; import com.doumee.dao.web.response.OrderCommentResponse; import com.doumee.dao.web.response.OrderDetailResponse; import com.doumee.dao.web.response.goods.MemberOrderDetailResponse; import com.github.yulichang.base.mapper.MPJJoinMapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; /** * @author 江蹄蹄 * @date 2023/03/21 15:48 */ public interface GoodsorderDetailMapper extends MPJJoinMapper { @Select(" select o.* , g.STATUS , g.PRICE as titlePrice " + " from goodsorder_detail o " + " left join goodsorder g on o.ORDER_ID = g.id " + " left join goods_sku gs on o.GOODS_SKU_ID = gs.id " + " ${ew.customSqlSegment} ") IPage queryPage(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); @Select(" select case when o.IMGURL is null || o.IMGURL = '' then g2.IMGURL else o.IMGURL end imgUrl , o.* ,o.id as orderDetailId , g.STATUS , o.name as goodsName ," + " ( select a.`STATUS` from aftersale a where a.DETAIL_ID = o.id order by a.CREATE_DATE desc LIMIT 1 ) as afterStatus " + " from goodsorder_detail o " + " left join goodsorder g on o.ORDER_ID = g.id " + " left join goods_sku gs on o.GOODS_SKU_ID = gs.id " + " left join goods g2 on gs.GOODS_ID = g2.id " + " where 1 = 1 and o.ORDER_ID = #{orderId} ") List getDetailList(@Param("orderId") Integer orderId); }