From fc3d04ca33de050d720499a0b8b39ea0d97f26d3 Mon Sep 17 00:00:00 2001 From: liuyingfang <1357764963@qq.com> Date: Mon, 1 Apr 2024 17:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=B8=8A=E5=8D=8A=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/auth/LoginFilter.java | 2 + .../controller/HomeController.java | 31 +++ .../dao/TbPlatformDictMapper.java | 85 ++++++ .../dao/TbProductSkuMapper.java | 2 + .../cashierservice/dao/TbShopInfoMapper.java | 9 + .../cashierservice/entity/TbPlatformDict.java | 194 ++++++++++++++ .../cashierservice/entity/dto/HomeDto.java | 76 ++++++ .../cashierservice/entity/vo/DistrictVO.java | 19 ++ .../cashierservice/entity/vo/HomeUpVO.java | 22 ++ .../cashierservice/entity/vo/HomeVO.java | 128 +++++++++ .../cashierservice/entity/vo/UserDutyVo.java | 29 ++ .../cashierservice/entity/vo/carouselVO.java | 16 ++ .../service/HomePageService.java | 93 +++++++ .../resources/mapper/TbPlatformDictMapper.xml | 248 ++++++++++++++++++ .../resources/mapper/TbProductSkuMapper.xml | 15 ++ .../resources/mapper/TbShopInfoMapper.xml | 27 ++ 16 files changed, 996 insertions(+) create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlatformDictMapper.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlatformDict.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/DistrictVO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeVO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserDutyVo.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/carouselVO.java create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java create mode 100644 src/main/resources/mapper/TbPlatformDictMapper.xml diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java index 99e13eb..19b5294 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java @@ -37,6 +37,8 @@ public class LoginFilter implements Filter { "css/**", "js/**", "cashierService/phoneValidateCode",//验证码 + "cashierService/home/homePageUp",//首页上半 + "cashierService/home",//首页 "cashierService/login/**"//登录部分接口不校验 ); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java new file mode 100644 index 0000000..31409a7 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/HomeController.java @@ -0,0 +1,31 @@ +package com.chaozhanggui.system.cashierservice.controller; + + +import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto; +import com.chaozhanggui.system.cashierservice.service.HomePageService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author lyf + */ +@RestController +@RequestMapping("/home") +@RequiredArgsConstructor +public class HomeController { + + @Resource + private HomePageService homePageService; + + @PostMapping + public Result homePage(@RequestBody HomeDto homeDto){ + return homePageService.homePage(homeDto); + } + @PostMapping("/homePageUp") + public Result homePageUp(@RequestHeader("environment") String environment){ + return homePageService.homePageUp(environment); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlatformDictMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlatformDictMapper.java new file mode 100644 index 0000000..fa1ce5b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlatformDictMapper.java @@ -0,0 +1,85 @@ +package com.chaozhanggui.system.cashierservice.dao; + + +import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; +import java.util.List; + +/** + * (TbPlatformDict)表数据库访问层 + * + * @author lyf + * @since 2024-04-01 14:38:09 + */ +public interface TbPlatformDictMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + TbPlatformDict queryById(Integer id); + + /** + * 查询指定行数据 + * + * @param tbPlatformDict 查询条件 + * @param pageable 分页对象 + * @return 对象列表 + */ + List queryAllByLimit(TbPlatformDict tbPlatformDict, @Param("pageable") Pageable pageable); + + List queryAllByType(@Param("type") String type,@Param("environment") String environment); + /** + * 统计总行数 + * + * @param tbPlatformDict 查询条件 + * @return 总行数 + */ + long count(TbPlatformDict tbPlatformDict); + + /** + * 新增数据 + * + * @param tbPlatformDict 实例对象 + * @return 影响行数 + */ + int insert(TbPlatformDict tbPlatformDict); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param tbPlatformDict 实例对象 + * @return 影响行数 + */ + int update(TbPlatformDict tbPlatformDict); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 影响行数 + */ + int deleteById(Integer id); + +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java index 8409119..aaeecbb 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java @@ -31,4 +31,6 @@ public interface TbProductSkuMapper { void updateAddStockById(@Param("skuId") String skuId, @Param("num") Integer num); List selectAll(); + + List selectDownSku(@Param("list") List productId); } \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java index 42f5b48..66d027e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java @@ -1,9 +1,14 @@ package com.chaozhanggui.system.cashierservice.dao; import com.chaozhanggui.system.cashierservice.entity.TbShopInfo; +import com.chaozhanggui.system.cashierservice.entity.vo.HomeVO; +import com.chaozhanggui.system.cashierservice.entity.vo.UserDutyVo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import java.util.List; + @Component @Mapper public interface TbShopInfoMapper { @@ -24,4 +29,8 @@ public interface TbShopInfoMapper { TbShopInfo selectByQrCode(String qrcode); TbShopInfo selectByPhone(String phone); + + List selectShopInfo(@Param("page")Integer page, @Param("size")Integer size); + + List searchUserDutyDetail(@Param("list") List productId); } \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlatformDict.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlatformDict.java new file mode 100644 index 0000000..55e42cf --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlatformDict.java @@ -0,0 +1,194 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +/** + * (TbPlatformDict)实体类 + * + * @author lyf + * @since 2024-04-01 14:42:50 + */ +public class TbPlatformDict implements Serializable { + private static final long serialVersionUID = -34581903392247717L; + + private Integer id; + /** + * 描述 同类型下 name唯一 + */ + private String name; + /** + * homeDistrict--金刚区(首页) carousel--轮播图 tag--标签 + */ + private String type; + /** + * 封面图 + */ + private String coverImg; + /** + * 分享图 + */ + private String shareImg; + /** + * 视频URL地址 + */ + private String video; + /** + * 视频封面图 + */ + private String videoCoverImg; + /** + * 相对跳转地址 + */ + private String relUrl; + /** + * 绝对跳转地址 + */ + private String absUrl; + /** + * 创建时间 + */ + private Long createdAt; + /** + * 更新时间 + */ + private Long updatedAt; + /** + * 收银端展示 0:不展示 1:展示 + */ + private Integer isShowCash; + /** + * 小程序端展示 0:不展示 1:展示 + */ + private Integer isShowMall; + /** + * APP端展示 0:不展示 1:展示 + */ + private Integer isShowApp; + /** + * 排序 + */ + private Integer sort; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCoverImg() { + return coverImg; + } + + public void setCoverImg(String coverImg) { + this.coverImg = coverImg; + } + + public String getShareImg() { + return shareImg; + } + + public void setShareImg(String shareImg) { + this.shareImg = shareImg; + } + + public String getVideo() { + return video; + } + + public void setVideo(String video) { + this.video = video; + } + + public String getVideoCoverImg() { + return videoCoverImg; + } + + public void setVideoCoverImg(String videoCoverImg) { + this.videoCoverImg = videoCoverImg; + } + + public String getRelUrl() { + return relUrl; + } + + public void setRelUrl(String relUrl) { + this.relUrl = relUrl; + } + + public String getAbsUrl() { + return absUrl; + } + + public void setAbsUrl(String absUrl) { + this.absUrl = absUrl; + } + + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Long getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public Integer getIsShowCash() { + return isShowCash; + } + + public void setIsShowCash(Integer isShowCash) { + this.isShowCash = isShowCash; + } + + public Integer getIsShowMall() { + return isShowMall; + } + + public void setIsShowMall(Integer isShowMall) { + this.isShowMall = isShowMall; + } + + public Integer getIsShowApp() { + return isShowApp; + } + + public void setIsShowApp(Integer isShowApp) { + this.isShowApp = isShowApp; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java new file mode 100644 index 0000000..caaf363 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/HomeDto.java @@ -0,0 +1,76 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +/** + * @author 12847 + */ +public class HomeDto { + /** + * 地址 + */ + private String address; + /** + * 品类 + */ + private String type; + + /** + * 1.理我最近 2.销量优先 3.价格优先 + */ + private Integer orderBy; + /** + * 附近1KM 1 0 + */ + private Integer distance; + + private Integer page; + + private Integer size; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getOrderBy() { + return orderBy; + } + + public void setOrderBy(Integer orderBy) { + this.orderBy = orderBy; + } + + public Integer getDistance() { + return distance; + } + + public void setDistance(Integer distance) { + this.distance = distance; + } + + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + public Integer getSize() { + return size; + } + + public void setSize(Integer size) { + this.size = size; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/DistrictVO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/DistrictVO.java new file mode 100644 index 0000000..aff7937 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/DistrictVO.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +/** + * @author lyf + */ +public class DistrictVO { + /** + * 图片 + */ + private String icon; + /** + * 菜单名 + */ + private String name; + /** + * 跳转地址 + */ + private String relUrl; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java new file mode 100644 index 0000000..0d45eac --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeUpVO.java @@ -0,0 +1,22 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; +import lombok.Data; + +import java.util.List; + +/** + * @author lyf + */ +@Data +public class HomeUpVO { + /** + * 轮播图 + */ + List carousel; + /** + * 金刚区 + */ + List district; + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeVO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeVO.java new file mode 100644 index 0000000..de2d5fb --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/HomeVO.java @@ -0,0 +1,128 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import java.math.BigDecimal; + +/** + * @author lyf + */ +public class HomeVO { + /** + * 店铺名称 + */ + private String shopName; + /** + * 距离 + */ + private String distance; + /** + * 商品名称 + */ + private String productName; + /** + * 商品图片 + */ + private String image; + /** + * 原价 + */ + private BigDecimal originPrice; + /** + * 现价 + */ + private BigDecimal salePrice; + /** + * 折扣 + */ + private BigDecimal discount; + /** + * 共省金额 + */ + private BigDecimal save; + + /** + * 销量 + */ + private BigDecimal realSalesNumber; + + private Integer productId; + + public Integer getProductId() { + return productId; + } + + public void setProductId(Integer productId) { + this.productId = productId; + } + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public BigDecimal getOriginPrice() { + return originPrice; + } + + public void setOriginPrice(BigDecimal originPrice) { + this.originPrice = originPrice; + } + + public BigDecimal getSalePrice() { + return salePrice; + } + + public void setSalePrice(BigDecimal salePrice) { + this.salePrice = salePrice; + } + + public BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public BigDecimal getSave() { + return save; + } + + public void setSave(BigDecimal save) { + this.save = save; + } + + public BigDecimal getRealSalesNumber() { + return realSalesNumber; + } + + public void setRealSalesNumber(BigDecimal realSalesNumber) { + this.realSalesNumber = realSalesNumber; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserDutyVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserDutyVo.java new file mode 100644 index 0000000..c81205b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserDutyVo.java @@ -0,0 +1,29 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import java.math.BigDecimal; + +/** + * @author lyf + */ +public class UserDutyVo { + + private BigDecimal number; + + private Integer productId; + + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public Integer getProductId() { + return productId; + } + + public void setProductId(Integer productId) { + this.productId = productId; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/carouselVO.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/carouselVO.java new file mode 100644 index 0000000..d7cffc7 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/carouselVO.java @@ -0,0 +1,16 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +/** + * 轮播图 + * @author lyf + */ +public class carouselVO { + /** + * 封面图 + */ + private String coverImg; + /** + * 跳转地址 + */ + private String relUrl; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java new file mode 100644 index 0000000..1478255 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/HomePageService.java @@ -0,0 +1,93 @@ +package com.chaozhanggui.system.cashierservice.service; + +import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper; +import com.chaozhanggui.system.cashierservice.dao.TbProductSkuMapper; +import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper; +import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict; +import com.chaozhanggui.system.cashierservice.entity.TbProductSku; +import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto; +import com.chaozhanggui.system.cashierservice.entity.vo.HomeUpVO; +import com.chaozhanggui.system.cashierservice.entity.vo.HomeVO; +import com.chaozhanggui.system.cashierservice.entity.vo.UserDutyVo; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; + +/** + * @author lyf + */ +@Service +@Slf4j +public class HomePageService { + @Resource + private TbShopInfoMapper shopInfoMapper; + @Resource + private TbProductSkuMapper productSkuMapper; + @Resource + private TbPlatformDictMapper platformDictMapper; + + + public Result homePage(HomeDto homeDto){ + int beginNo; + if(homeDto.getPage() <=0){ + beginNo = 0; + }else{ + beginNo = (homeDto.getPage() - 1) * homeDto.getSize(); + } + List homeVO = shopInfoMapper.selectShopInfo(beginNo,homeDto.getSize()); + List objects = new ArrayList<>(); + for (HomeVO o :homeVO) { + objects.add(o.getProductId()); + } + //原价现价 + List tbProductSkus = productSkuMapper.selectDownSku(objects); + //销量 + List userDutyVos = shopInfoMapper.searchUserDutyDetail(objects); + //组装数据 + for (HomeVO o :homeVO) { + for (TbProductSku sku :tbProductSkus) { + if (o.getProductId().toString().equals(sku.getProductId())){ + o.setOriginPrice(sku.getOriginPrice() == null?BigDecimal.ZERO:sku.getOriginPrice()); + o.setSalePrice(sku.getSalePrice() == null?BigDecimal.ZERO:sku.getSalePrice()); + } + } + if (userDutyVos == null){ + o.setRealSalesNumber(BigDecimal.ZERO); + }else { + for (UserDutyVo duty : userDutyVos) { + if (o.getProductId().equals(duty.getProductId())) { + o.setRealSalesNumber(duty.getNumber()); + }else { + o.setRealSalesNumber(BigDecimal.ZERO); + } + } + } + //共省金额 + o.setSave(o.getOriginPrice().subtract(o.getSalePrice())); + if (o.getOriginPrice().compareTo(BigDecimal.ZERO) == 0){ + o.setDiscount(null); + }else { + o.setDiscount(o.getSalePrice().divide(o.getOriginPrice(), 2, RoundingMode.DOWN).multiply(new BigDecimal("10"))); + } + } + return Result.success(CodeEnum.SUCCESS,homeVO); + } + + public Result homePageUp(String environment){ + HomeUpVO homeUpVO = new HomeUpVO(); + //轮播图 + List carouselList = platformDictMapper.queryAllByType("carousel",environment); + homeUpVO.setCarousel(carouselList); + //金刚区 + List districtList = platformDictMapper.queryAllByType("homeDistrict",environment); + homeUpVO.setDistrict(districtList); + return Result.success(CodeEnum.SUCCESS,homeUpVO); + } +} diff --git a/src/main/resources/mapper/TbPlatformDictMapper.xml b/src/main/resources/mapper/TbPlatformDictMapper.xml new file mode 100644 index 0000000..fa4182b --- /dev/null +++ b/src/main/resources/mapper/TbPlatformDictMapper.xml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort) + values (#{name}, #{type}, #{coverImg}, #{shareImg}, #{video}, #{videoCoverImg}, #{relUrl}, #{absUrl}, #{createdAt}, #{updatedAt}, #{isShowCash}, #{isShowMall}, #{isShowApp}, #{sort}) + + + + insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort) + values + + (#{entity.name}, #{entity.type}, #{entity.coverImg}, #{entity.shareImg}, #{entity.video}, #{entity.videoCoverImg}, #{entity.relUrl}, #{entity.absUrl}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.isShowCash}, #{entity.isShowMall}, #{entity.isShowApp}, #{entity.sort}) + + + + + insert into tb_platform_dict(name, type, cover_img, share_img, video, video_cover_img, rel_url, abs_url, created_at, updated_at, is_show_cash, is_show_mall, is_show_app, sort) + values + + (#{entity.name}, #{entity.type}, #{entity.coverImg}, #{entity.shareImg}, #{entity.video}, #{entity.videoCoverImg}, #{entity.relUrl}, #{entity.absUrl}, #{entity.createdAt}, #{entity.updatedAt}, #{entity.isShowCash}, #{entity.isShowMall}, #{entity.isShowApp}, #{entity.sort}) + + on duplicate key update + name = values(name), + type = values(type), + cover_img = values(cover_img), + share_img = values(share_img), + video = values(video), + video_cover_img = values(video_cover_img), + rel_url = values(rel_url), + abs_url = values(abs_url), + created_at = values(created_at), + updated_at = values(updated_at), + is_show_cash = values(is_show_cash), + is_show_mall = values(is_show_mall), + is_show_app = values(is_show_app), + sort = values(sort) + + + + + update tb_platform_dict + + + name = #{name}, + + + type = #{type}, + + + cover_img = #{coverImg}, + + + share_img = #{shareImg}, + + + video = #{video}, + + + video_cover_img = #{videoCoverImg}, + + + rel_url = #{relUrl}, + + + abs_url = #{absUrl}, + + + created_at = #{createdAt}, + + + updated_at = #{updatedAt}, + + + is_show_cash = #{isShowCash}, + + + is_show_mall = #{isShowMall}, + + + is_show_app = #{isShowApp}, + + + sort = #{sort}, + + + where id = #{id} + + + + + delete from tb_platform_dict where id = #{id} + + + + diff --git a/src/main/resources/mapper/TbProductSkuMapper.xml b/src/main/resources/mapper/TbProductSkuMapper.xml index 6ba93af..969e918 100644 --- a/src/main/resources/mapper/TbProductSkuMapper.xml +++ b/src/main/resources/mapper/TbProductSkuMapper.xml @@ -355,4 +355,19 @@ + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopInfoMapper.xml b/src/main/resources/mapper/TbShopInfoMapper.xml index bad0fbf..0634beb 100644 --- a/src/main/resources/mapper/TbShopInfoMapper.xml +++ b/src/main/resources/mapper/TbShopInfoMapper.xml @@ -617,4 +617,31 @@ + + \ No newline at end of file