DESKTOP-71BH0QO\L、ming
2021-04-17 4a4e85169490d2b419a99f5d40d95937b798ecce
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopGoodsDAO.java
@@ -4,9 +4,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO;
import com.panzhihua.common.model.vos.shop.ComShopStoreVO;
import com.panzhihua.common.model.vos.shop.PageShopGoodsVO;
import com.panzhihua.common.model.vos.shop.PageShopStoreVO;
import com.panzhihua.service_community.model.dos.ComShopGoodsDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
@@ -17,7 +19,21 @@
@Mapper
public interface ComShopGoodsDAO extends BaseMapper<ComShopGoodsDO> {
    @Select("select id,type_id,name,store_id,goods_pic,images,status,sale,original_price,price,unit,order,stock,details,remark,goods_describe,delivery_type,delete_status,create_at,update_at from com_shop_store")
    IPage<ComShopStoreVO> pageShopGoods(Page page, PageComShopGoodsDTO pageComShopGoodsDTO);
    @Select("<script>" +
            "select c.id,c.type_id,css.name as storeName,c.name,c.store_id,c.goods_pic,c.images,c.status,c.sale,c.original_price,c.price,c.unit,c.order,c.stock,c.details,c.remark,c.goods_describe,c.delivery_type,c.delete_status,c.create_at,c.update_at from com_shop_goods c \n" +
            "right join com_shop_store css on c.store_id=css.id\n" +
            " <where>" +
            "<if test='pageComShopGoodsDTO.storeName != null and pageComShopGoodsDTO.storeName.trim() != &quot;&quot;'>" +
            "and css.name like concat('%',#{pageComShopGoodsDTO.storeName},'%') \n" +
            " </if> " +
            "<if test='pageComShopGoodsDTO.name != null and pageComShopGoodsDTO.name.trim() != &quot;&quot;'>" +
            "and c.name like concat('%',#{pageComShopGoodsDTO.name},'%') \n" +
            " </if> " +
            "<if test='pageComShopGoodsDTO.status != null'>" +
            "and c.status like concat('%',#{pageComShopGoodsDTO.status},'%') \n" +
            " </if> " +
            " </where>" +
            "</script>")
    IPage<PageShopGoodsVO> pageShopGoods(Page page, @Param("pageComShopGoodsDTO")  PageComShopGoodsDTO pageComShopGoodsDTO);
}