提交 f2a1432b 作者: xiaowang

新增:商品列表

上级 1a012e0e
...@@ -8,6 +8,7 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDTO; ...@@ -8,6 +8,7 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO; import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO; import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.*; import com.mmc.pms.model.sale.dto.*;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; import com.mmc.pms.model.sale.vo.GoodsAddVO;
import com.mmc.pms.service.GoodsInfoService; import com.mmc.pms.service.GoodsInfoService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
...@@ -51,6 +52,13 @@ public class BackstageGoodsManageController { ...@@ -51,6 +52,13 @@ public class BackstageGoodsManageController {
return goodsInfoService.getGoodsInfoDetail(goodsInfoId); return goodsInfoService.getGoodsInfoDetail(goodsInfoId);
} }
@ApiOperation(value = "商品列表-分页")
@PostMapping("listPageGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody MallGoodsQO param) {
return ResultBody.success(goodsInfoService.listPageGoodsInfo(param));
}
@ApiOperation(value = "单位信息") @ApiOperation(value = "单位信息")
@GetMapping("getSkuUnit") @GetMapping("getSkuUnit")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)})
......
package com.mmc.pms.controller; package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.model.lease.dto.BrandDTO;
import com.mmc.pms.model.lease.dto.DeviceCategoryDTO;
import com.mmc.pms.model.lease.dto.WareInfoDTO;
import com.mmc.pms.model.lease.vo.LeaseVo;
import com.mmc.pms.model.other.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.other.dto.DistrictInfoDTO; import com.mmc.pms.model.other.dto.DistrictInfoDTO;
import com.mmc.pms.model.other.dto.ModelDTO;
import com.mmc.pms.service.WebDeviceService; import com.mmc.pms.service.WebDeviceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @Author small @Date 2023/5/15 13:25 @Version 1.0 * @Author small @Date 2023/5/15 13:25 @Version 1.0
...@@ -25,75 +21,18 @@ import org.springframework.web.bind.annotation.*; ...@@ -25,75 +21,18 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/webDevice") @RequestMapping("/webDevice")
public class WebDeviceController { public class WebDeviceController {
@Autowired @Autowired private WebDeviceService webDeviceService;
private WebDeviceService webDeviceService;
@ApiOperation(value = "地域") @ApiOperation(value = "地域")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/getSecondDistrictInfo") @GetMapping("/getSecondDistrictInfo")
public ResultBody<DistrictInfoDTO> getSecondDistrictInfo() { public ResultBody<DistrictInfoDTO> getSecondDistrictInfo() {
return webDeviceService.listSecondDistrict(); return webDeviceService.listSecondDistrict();
} }
@ApiOperation("设备类目")
@GetMapping("/category")
public ResultBody<DeviceCategoryDTO> category() {
return webDeviceService.category();
}
@ApiOperation("品牌")
@GetMapping("/brand")
public ResultBody<BrandDTO> brand() {
return webDeviceService.brand();
}
@ApiOperation("型号")
@GetMapping("/model")
public ResultBody<ModelDTO> model() {
return webDeviceService.model();
}
@ApiOperation("设备品牌")
@GetMapping("/deviceBrand")
public ResultBody<BrandDTO> deviceBrand() {
return webDeviceService.deviceBrand();
}
@ApiOperation("设备型号")
@GetMapping("/deviceModel")
public ResultBody<ModelDTO> deviceModel() {
return webDeviceService.deviceModel();
}
@ApiOperation(value = "设备详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/detail")
public ResultBody<WareInfoDTO> detail(@RequestParam(value = "id", required = true) Integer id) {
WareInfoDTO wareInfoDTO = webDeviceService.getWareInfoById(id);
return wareInfoDTO == null
? ResultBody.error(ResultEnum.NOT_FOUND)
: ResultBody.success(wareInfoDTO);
}
@ApiOperation(value = "立即租赁")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/update")
public ResultBody update(@RequestBody LeaseVo param) {
return webDeviceService.update(param);
}
@ApiOperation("设备广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> ad() {
return webDeviceService.ad();
}
//
// @ApiOperation(value = "设备列表筛选")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = WareInfoItemDTO.class)})
// @PostMapping("/deviceList")
// public ResultBody<WareInfoItemDTO> listWareInfoPage(
// @RequestBody @Validated(Page.class) WareInfoQO param) {
// return webDeviceService.listWareInfoPage(param, request);
// }
@ApiOperation("设备广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> ad() {
return webDeviceService.ad();
}
} }
package com.mmc.pms.dao; package com.mmc.pms.dao;
import com.mmc.pms.entity.*; import com.mmc.pms.entity.*;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; import com.mmc.pms.model.sale.vo.GoodsAddVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -96,4 +97,8 @@ public interface GoodsInfoDao { ...@@ -96,4 +97,8 @@ public interface GoodsInfoDao {
List<MallProdSkuInfoSpecDO> listMallprodSpecById(List<Integer> goodsIds); List<MallProdSkuInfoSpecDO> listMallprodSpecById(List<Integer> goodsIds);
List<SaleServiceDO> listSaleServiceInfo(); List<SaleServiceDO> listSaleServiceInfo();
int countListGoodsInfo(MallGoodsQO param);
List<GoodsInfo> listGoodsInfo(MallGoodsQO param);
} }
...@@ -82,8 +82,6 @@ public interface ProductDao { ...@@ -82,8 +82,6 @@ public interface ProductDao {
void removeProductSku(Integer id); void removeProductSku(Integer id);
List<MallProdInfoDO> listMallProdInfo(String id);
void removeProductSpec(Integer id); void removeProductSpec(Integer id);
List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds); List<IndustrySpecDO> listIndustrySpec(@Param("industrySpecIds") Set<Integer> industrySpecIds);
......
...@@ -2,6 +2,7 @@ package com.mmc.pms.entity; ...@@ -2,6 +2,7 @@ package com.mmc.pms.entity;
import com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO; import com.mmc.pms.model.categories.vo.RelevanceGoodsInfoVO;
import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO; import com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; import com.mmc.pms.model.sale.vo.GoodsAddVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -11,73 +12,94 @@ import java.io.Serializable; ...@@ -11,73 +12,94 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* @author 23214 * @author 23214 @TableName goods_info
* @TableName goods_info
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class GoodsInfo implements Serializable { public class GoodsInfo implements Serializable {
private Integer id; private Integer id;
private Integer pid; private Integer pid;
private String goodsNo; private String goodsNo;
private String goodsName; private String goodsName;
private Integer directoryId; private Integer directoryId;
private Integer addGoodsUserId; private Integer addGoodsUserId;
private Integer categoryByOne; private Integer categoryByOne;
private Integer categoryByTwo; private Integer categoryByTwo;
private String ecoLabel; private String ecoLabel;
private Integer shelfStatus; private Integer shelfStatus;
private Integer showCode; private Integer showCode;
private Integer sort; private Integer sort;
private Date createTime; private Date createTime;
private Integer goodsType; private Integer goodsType;
private Date updateTime; private Date updateTime;
private Integer deleted; private Integer deleted;
private Integer goodsVideoId; private Integer goodsVideoId;
private String videoUrl; private String videoUrl;
private String mainImg; private String mainImg;
private static final long serialVersionUID = 1L; private Integer isCoupons;
public GoodsInfo(GoodsAddVO goodsAddVO) { private String directoryName;
this.id = goodsAddVO.getId();
this.goodsName = goodsAddVO.getGoodsName();
this.shelfStatus = goodsAddVO.getShelfStatus();
this.categoryByOne = goodsAddVO.getCategoryByOne();
this.categoryByTwo = goodsAddVO.getCategoryByTwo();
this.directoryId = goodsAddVO.getDirectoryId();
this.ecoLabel = goodsAddVO.getTag();
this.goodsType = goodsAddVO.getGoodsType();
}
public GoodsInfo(Integer id) { private static final long serialVersionUID = 1L;
this.id = id;
}
public RelevanceGoodsInfoVO buildRelevanceGoodsInfoVO() { public GoodsInfo(GoodsAddVO goodsAddVO) {
return RelevanceGoodsInfoVO.builder().id(id).goodsName(goodsName).shelf(shelfStatus).mainImage(mainImg).build(); this.id = goodsAddVO.getId();
} this.goodsName = goodsAddVO.getGoodsName();
this.shelfStatus = goodsAddVO.getShelfStatus();
this.categoryByOne = goodsAddVO.getCategoryByOne();
this.categoryByTwo = goodsAddVO.getCategoryByTwo();
this.directoryId = goodsAddVO.getDirectoryId();
this.ecoLabel = goodsAddVO.getTag();
this.goodsType = goodsAddVO.getGoodsType();
}
public LeaseGoodsInfoDTO buildLeaseGoodsInfoDTO() { public GoodsInfo(Integer id) {
return LeaseGoodsInfoDTO.builder().id(id).goodsName(goodsName).images(mainImg).build(); this.id = id;
} }
}
\ No newline at end of file public RelevanceGoodsInfoVO buildRelevanceGoodsInfoVO() {
return RelevanceGoodsInfoVO.builder()
.id(id)
.goodsName(goodsName)
.shelf(shelfStatus)
.mainImage(mainImg)
.build();
}
public LeaseGoodsInfoDTO buildLeaseGoodsInfoDTO() {
return LeaseGoodsInfoDTO.builder().id(id).goodsName(goodsName).images(mainImg).build();
}
public GoodsInfoListDTO buildGoodsInfoListDTO() {
return GoodsInfoListDTO.builder()
.id(id)
.goodsName(goodsName)
.directoryName(directoryName)
.directoryId(directoryId)
.createTime(createTime)
.imgUrl(mainImg)
.status(shelfStatus)
.isCoupons(this.isCoupons)
.build();
}
}
package com.mmc.pms.model.sale.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author LW
*
* @date 2022/3/22 9:44 概要:商品列表查询QO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallGoodsQO {
@ApiModelProperty(value = "商品名称", example = "商品名称")
private String goodsName;
@ApiModelProperty(value = "商品类型 0:销售 1:租赁", example = "0")
private Integer goodsType;
@ApiModelProperty(value = "开始时间", example = "2023-06-09 00:00:00")
private String startTime;
@ApiModelProperty(value = "结束时间", example = "2023-06-11 23:59:59")
private String endTime;
@ApiModelProperty(value = "状态 0:下架(仓库中)1:上架", example = "1")
private Integer status;
@ApiModelProperty(value = "目录id", example = "1")
private Integer directoryId;
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(
message = "页码不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(
message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
...@@ -8,7 +8,9 @@ import com.mmc.pms.model.qo.ProductSpecPriceQO; ...@@ -8,7 +8,9 @@ import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.MallGoodsShopCarDTO; import com.mmc.pms.model.sale.dto.MallGoodsShopCarDTO;
import com.mmc.pms.model.sale.dto.MallProductSpecPriceDTO; import com.mmc.pms.model.sale.dto.MallProductSpecPriceDTO;
import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO; import com.mmc.pms.model.sale.dto.ProductSpecPriceDTO;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.GoodsAddVO; import com.mmc.pms.model.sale.vo.GoodsAddVO;
import com.mmc.pms.page.PageResult;
import java.util.List; import java.util.List;
...@@ -38,4 +40,6 @@ public interface GoodsInfoService { ...@@ -38,4 +40,6 @@ public interface GoodsInfoService {
List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
PageResult listPageGoodsInfo(MallGoodsQO param);
} }
...@@ -12,7 +12,9 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDetailDTO; ...@@ -12,7 +12,9 @@ import com.mmc.pms.model.order.dto.OrderGoodsProdDetailDTO;
import com.mmc.pms.model.qo.MallOrderGoodsInfoQO; import com.mmc.pms.model.qo.MallOrderGoodsInfoQO;
import com.mmc.pms.model.qo.ProductSpecPriceQO; import com.mmc.pms.model.qo.ProductSpecPriceQO;
import com.mmc.pms.model.sale.dto.*; import com.mmc.pms.model.sale.dto.*;
import com.mmc.pms.model.sale.qo.MallGoodsQO;
import com.mmc.pms.model.sale.vo.*; import com.mmc.pms.model.sale.vo.*;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.GoodsInfoService; import com.mmc.pms.service.GoodsInfoService;
import com.mmc.pms.util.CodeUtil; import com.mmc.pms.util.CodeUtil;
import com.mmc.pms.util.TDateUtil; import com.mmc.pms.util.TDateUtil;
...@@ -1102,4 +1104,18 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -1102,4 +1104,18 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
} }
return mallGoodsInfoSimpleDOS; return mallGoodsInfoSimpleDOS;
} }
@Override
public PageResult listPageGoodsInfo(MallGoodsQO param) {
int count = goodsInfoDao.countListGoodsInfo(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
}
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfo> goodsInfo = goodsInfoDao.listGoodsInfo(param);
List<GoodsInfoListDTO> pageList =
goodsInfo.stream().map(GoodsInfo::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
} }
...@@ -3,9 +3,13 @@ package com.mmc.pms.service.Impl; ...@@ -3,9 +3,13 @@ package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.WebProductMallDao; import com.mmc.pms.dao.WebProductMallDao;
import com.mmc.pms.entity.AdDO; import com.mmc.pms.entity.AdDO;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory; import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.other.dto.AdDTO; import com.mmc.pms.model.other.dto.AdDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.model.sale.dto.GoodsInfoListDTO;
import com.mmc.pms.model.sale.dto.ProductCategoryDTO; import com.mmc.pms.model.sale.dto.ProductCategoryDTO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.WebProductMallService; import com.mmc.pms.service.WebProductMallService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -72,4 +76,24 @@ public class WebProductMallServiceImpl implements WebProductMallService { ...@@ -72,4 +76,24 @@ public class WebProductMallServiceImpl implements WebProductMallService {
.collect(Collectors.toList()); .collect(Collectors.toList());
return ResultBody.success(collect); return ResultBody.success(collect);
} }
@Override
public PageResult listPageGoodsInfo(GoodsInfoQO param) {
int count = webProductMallDao.countListGoodsInfo(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
}
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
List<GoodsInfoDO> goodsInfo = webProductMallDao.listGoodsInfo(param);
goodsInfo.stream()
.forEach(
t -> {
Integer product = webProductMallDao.findProduct(t.getId());
t.setIsCoupons(product);
});
List<GoodsInfoListDTO> pageList =
goodsInfo.stream().map(GoodsInfoDO::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
} }
package com.mmc.pms.service; package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.GoodsInfoQO;
/** /**
* @Author small @Date 2023/5/16 15:08 @Version 1.0 * @Author small @Date 2023/5/16 15:08 @Version 1.0
*/ */
public interface MiniProgramProductMallService { public interface MiniProgramProductMallService {
ResultBody getAppGoodsInfoDetail(Integer id); ResultBody getAppGoodsInfoDetail(Integer id);
ResultBody listGoodsByQO(GoodsInfoQO param);
} }
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<foreach collection="list" item="d" separator=";"> <foreach collection="list" item="d" separator=";">
update mall_prod_info update mall_prod_info
<set> <set>
prod_sku_id = #{d.prodSkuId}, product_id = #{d.prodSkuId},
categories_id = #{d.categoriesId}, categories_id = #{d.categoriesId},
prod_spec_name = #{d.prodSkuSpecName}, prod_spec_name = #{d.prodSkuSpecName},
choose_type = #{d.chooseType}, choose_type = #{d.chooseType},
...@@ -487,4 +487,65 @@ ...@@ -487,4 +487,65 @@
FROM sale_service FROM sale_service
WHERE is_deleted = 0 WHERE is_deleted = 0
</select> </select>
<select id="countListGoodsInfo" resultType="java.lang.Integer">
SELECT
count(*)
FROM
goods_info gi
<where>
gi.is_deleted = 0 and gi.goods_type = #{goodsType}
<if test="goodsName != null and goodsName !=''">
AND (gi.goods_name LIKE CONCAT('%',#{goodsName},'%'))
</if>
<if test="status != null">
AND (gi.shelf_status = #{status})
</if>
<if test="startTime != null and startTime != '' ">
and gi.create_time &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="endTime != null and endTime != '' ">
and gi.create_time &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="directoryId != null">
and (gi.directory_id = #{directoryId})
</if>
</where>
</select>
<select id="listGoodsInfo" resultType="com.mmc.pms.entity.GoodsInfo">
SELECT
gi.id,
gi.goods_name,
gi.shelf_status,
gi.create_time,
gi.directory_id,
img.img_url mainImg,
d.directory_name
FROM
goods_info gi
LEFT JOIN goods_img img ON gi.id = img.goods_info_id
AND img.img_type = 0
AND img.is_deleted = 0
INNER JOIN `directory` d ON gi.directory_id = d.id
<where>
gi.is_deleted = 0 and gi.goods_type = #{goodsType}
<if test="goodsName != null and goodsName !=''">
AND (gi.goods_name LIKE CONCAT('%',#{goodsName},'%'))
</if>
<if test="status != null">
AND (gi.shelf_status = #{status})
</if>
<if test="startTime != null and startTime != '' ">
and gi.create_time &gt;= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="endTime != null and endTime != '' ">
and gi.create_time &lt;= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="directoryId != null">
and (gi.directory_id = #{directoryId})
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time DESC
limit #{pageNo},#{pageSize}
</select>
</mapper> </mapper>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<select id="getMallProdInfoByGoodsId" resultType="com.mmc.pms.entity.MallProdInfoDO"> <select id="getMallProdInfoByGoodsId" resultType="com.mmc.pms.entity.MallProdInfoDO">
SELECT mp.id, SELECT mp.id,
mp.prod_sku_id prodSkuId, mp.product_id prodSkuId,
mp.prod_spec_name prodSkuSpecName, mp.prod_spec_name prodSkuSpecName,
mp.goods_type_id goodsTypeId, mp.goods_type_id goodsTypeId,
mp.choose_type chooseType, mp.choose_type chooseType,
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
ps.product_name productSkuName, ps.product_name productSkuName,
ps.brand_info_id brandInfoId, ps.brand_info_id brandInfoId,
gt.type_name typeName gt.type_name typeName
FROM mall_prod_sku_info mp FROM mall_prod_info mp
INNER JOIN sku_unit su ON su.id = mp.sku_unit_id INNER JOIN sku_unit su ON su.id = mp.sku_unit_id
INNER JOIN product ps ON ps.id = mp.prod_sku_id INNER JOIN product ps ON ps.id = mp.product_id
LEFT JOIN goods_type gt ON mp.goods_type_id = gt.id LEFT JOIN goods_type gt ON mp.goods_type_id = gt.id
WHERE mp.goods_info_id = #{goodsId} WHERE mp.goods_info_id = #{goodsId}
AND mp.is_deleted = 0 AND mp.is_deleted = 0
...@@ -143,9 +143,9 @@ ...@@ -143,9 +143,9 @@
<select id="listMallProdSkuInfoSpec" resultType="com.mmc.pms.entity.MallProdSkuInfoSpecDO"> <select id="listMallProdSkuInfoSpec" resultType="com.mmc.pms.entity.MallProdSkuInfoSpecDO">
SELECT id, SELECT id,
mall_prod_sku_info_id mallProdSkuInfoId, mall_prod_info_id mallProdSkuInfoId,
product_spec_id productSpecId product_spec_id productSpecId
FROM mall_prod_sku_info_spec FROM mall_prod_info_spec
WHERE goods_info_id = #{goodsId} WHERE goods_info_id = #{goodsId}
AND is_deleted = 0 AND is_deleted = 0
</select> </select>
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
</insert> </insert>
<insert id="insertMallProdSkuInfo" parameterType="com.mmc.pms.entity.MallProdInfoDO" <insert id="insertMallProdSkuInfo" parameterType="com.mmc.pms.entity.MallProdInfoDO"
keyProperty="id" useGeneratedKeys="true"> keyProperty="id" useGeneratedKeys="true">
insert into mall_prod_info (goods_info_id, prod_sku_id, prod_spec_name, category_id, choose_type, insert into mall_prod_info (goods_info_id, product_id, prod_spec_name, categories_id, choose_type,
sku_unit_id, is_must, product_spec_id_list, flag) sku_unit_id, is_must, flag)
values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categoryId}, #{chooseType}, #{skuUnitId}, #{must}, values (#{goodsInfoId}, #{prodSkuId}, #{prodSkuSpecName}, #{categoriesId}, #{chooseType}, #{skuUnitId}, #{must},
#{flag}) #{flag})
</insert> </insert>
<update id="updateProductSku"> <update id="updateProductSku">
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
SELECT count(1) SELECT count(1)
FROM goods_info gi FROM goods_info gi
INNER JOIN mall_prod_sku_info mpsi ON mpsi.goods_info_id = gi.id INNER JOIN mall_prod_sku_info mpsi ON mpsi.goods_info_id = gi.id
INNER JOIN product ps ON mpsi.prod_sku_id = ps.id INNER JOIN product ps ON mpsi.product_id = ps.id
AND ps.is_deleted = 0 AND ps.is_deleted = 0
INNER JOIN brand_info bi ON ps.brand_info_id = bi.id INNER JOIN brand_info bi ON ps.brand_info_id = bi.id
AND bi.is_delete = 0 AND bi.is_delete = 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论