Merge #52 into master from cc_20260121_store_type
Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type
* cc_20260121_store_type: (100 commits squashed)
- Merge branch 'master' into cc_20251208_visit
- feat:订单列表
- feat:订单列表
- fix:拜访记录导出
- feat:列表处理
- Merge branch 'cc_20251208_visit' into cc_20260121_store_type
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
- feat:标准店接口处理
- feat:标准店接口处理
- feat:标准店接口处理
- feat:标准店接口处理
- feat:标准店接口处理
- fix:加盟缴费调整
- feat:标准店接口处理
- fix:加盟缴费调整
- Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type
# Conflicts:
#	coolstore-partner-model/src/main/java/com/cool/store/dto/wallet/BatchTransferDTO.java
#	coolstore-partner-model/src/main/java/com/cool/store/request/wallet/BatchTransferRequest.java
- feat:冲突解决
- feat:接口处理
- feat:shopInfo
- fix:PC缴费信息列表过滤已完成缴费信息
- fix:测试接口修改
- Merge branch 'refs/heads/cc_20260126_pingan_wallet' into cc_20260121_store_type
- fix:测试接口修改
- feat:接口
- feat:接口调整
- feat:注释调整
- feat:key 调整
- feat:订单ID
- feat:日志打印
- feat:选择标准店型
- feat:useStandardStore
- feat:标准店没有缴费阶段
- feat:标准店没有缴费阶段
- feat:标准店没有缴费阶段
- feat:标准店没有缴费阶段
- feat:阶段调整
- fix:修复加盟缴费流程流转错误
- feat:费用类型ID
- feat:锁释放
- feat:分账状态
- fix:加盟签约合同数据补充
- feat:排序
- feat:选项单位
- feat:选项单位
- feat:选项单位
- feat:选项单位
- feat:option_unit
- feat:option_unit
- feat:更新调整
- feat:视频非必填
- feat:optionUnit
- fix:转义
- Merge branch 'master' into cc_20260126_pingan_wallet
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
- feat:同一配置项下只能设置一个默认选项
- feat:数量支持小数,新增首次订货字段
- fix:提交及修改校验合计缴费金额和分账总金额是否相同
- feat:queryPage
- feat:defaultQuantity 改为 BigDecimal
- feat:defaultQuantity 改为 BigDecimal
- feat:门店预约到店
- feat:门店预约到店 取消预约
- feat:门店预约到店 手机号
- feat:添加原价
- feat:添加原价
- feat:添加原价
- feat:字典表 remark
- Merge branch 'master' into cc_20260121_store_type
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
#	coolstore-partner-common/src/main/java/com/cool/store/enums/FileTypeEnum.java
#	coolstore-partner-model/src/main/java/com/cool/store/vo/dict/DictColumnSimpleVO.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/ExportRealizeService.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/ExportService.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ExportRealizeServiceImpl.java
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ExportServiceImpl.java
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webb/ExportController.java
- feat:字典表 remark
- feat:服务人员手机号
- feat:价格计算调整店型优惠价*默认数量 + 原价 *(选择数量-默认数量)
- fix:补充钱包账单推送新管家流程
- fix:账单推送钱包支付类型payWay由1改为2
- feat:同一配置项下只能设置一个默认选项 限制去掉
- fix:平安钱包分账信息改为非必填
- feat:同一配置项只能选择一个选项 限制去掉
- feat:心愿单
- feat:心愿单
- feat:心愿单接口调整
- feat:心愿单接口调整
- feat:心愿单接口调整
- feat:批量更新数据
- feat:查询店型已配置的选项绑定 新增顶部预览图
- feat:查询店型已配置的选项绑定 新增顶部预览图
- feat:查询店型已配置的选项绑定 新增顶部预览图
- feat:配置大类
- feat:配置大类
- feat:价格优化
- feat:阶段审批处理
- fix:删除设计费-立规
- feat:配置大项 配置项接口改造
- feat:配置大项 配置项接口改造
- feat:handleAudit
- feat:新增code
- feat:categoryId
- feat:心愿单接口更新
- feat:心愿单接口更新
- feat:心愿单接口更新
- feat:心愿单接口更新
- feat:心愿单接口更新
- Merge branch 'cc_20260126_pingan_wallet' into cc_20260121_store_type
# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/constants/RedisConstant.java
- Merge branch 'master' into cc_20260121_store_type
# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/SignFranchiseServiceImpl.java
Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/52
This commit is contained in:
@@ -42,4 +42,17 @@ public class FranchiseFeeDAO {
|
||||
}
|
||||
return franchiseFeeMapper.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
|
||||
}
|
||||
|
||||
public Boolean updatePayType(Long shopId, Integer payType) {
|
||||
if (shopId == null || payType == null){
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(FranchiseFeeDO.class);
|
||||
example.createCriteria().andEqualTo("shopId", shopId);
|
||||
return franchiseFeeMapper.updateByExampleSelective(FranchiseFeeDO.builder().payType(payType).build(), example) > 0;
|
||||
}
|
||||
|
||||
public FranchiseFeeDO selectByShopId(Long shopId) {
|
||||
return franchiseFeeMapper.selectByShopId(shopId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.BuildStageDTO;
|
||||
import com.cool.store.dto.PlatformBuildStageDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
@@ -41,11 +42,11 @@ public class ShopStageInfoDAO {
|
||||
|
||||
/**
|
||||
* 初始化店铺阶段信息
|
||||
* @param lineId
|
||||
* @param lineInfoDO
|
||||
* @param shopInfoList
|
||||
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
|
||||
*/
|
||||
public Integer initShopStageInfo(Long lineId, List<ShopInfoDO> shopInfoList, Boolean flag) {
|
||||
public Integer initShopStageInfo(LineInfoDO lineInfoDO, List<ShopInfoDO> shopInfoList, Boolean flag) {
|
||||
if (CollectionUtils.isEmpty(shopInfoList)) {
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
@@ -58,28 +59,27 @@ public class ShopStageInfoDAO {
|
||||
// 三明治跳过营帐通开通
|
||||
continue;
|
||||
}
|
||||
// TODO: 临时跳过
|
||||
if (shopSubStageEnum.equals(ShopSubStageEnum.SHOP_STAGE_6)) {
|
||||
continue;
|
||||
}
|
||||
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||
shopStageInfo.setLineId(lineId);
|
||||
shopStageInfo.setLineId(lineInfoDO.getId());
|
||||
shopStageInfo.setShopId(shopId);
|
||||
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
|
||||
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
|
||||
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
|
||||
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
||||
if (flag) {
|
||||
initStatus = shopSubStageEnum.getInitStatus();
|
||||
initStatus = shopSubStageEnum.getInitStatus(lineInfoDO.getUseStandardStore());
|
||||
}
|
||||
//标准店和普通店
|
||||
if (initStatus == null){
|
||||
continue;
|
||||
}
|
||||
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
|
||||
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
|
||||
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + initStatus.getShopSubStageStatusName());
|
||||
shopStageInfo.setIsTerminated(Boolean.FALSE);
|
||||
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(selectStartDate));
|
||||
addShopStageList.add(shopStageInfo);
|
||||
}
|
||||
}
|
||||
//发送短信
|
||||
return shopStageInfoMapper.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.cool.store.dao.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigItemCategoryDO;
|
||||
import com.cool.store.mapper.config.ConfigItemCategoryMapper;
|
||||
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemCategoryVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigItemCategoryDAO {
|
||||
|
||||
private final ConfigItemCategoryMapper configItemCategoryMapper;
|
||||
|
||||
public boolean insertSelective(ConfigItemCategoryDO entity) {
|
||||
return configItemCategoryMapper.insertSelective(entity) > 0;
|
||||
}
|
||||
|
||||
public boolean updateSelective(ConfigItemCategoryDO entity) {
|
||||
return configItemCategoryMapper.updateByPrimaryKeySelective(entity) > 0;
|
||||
}
|
||||
|
||||
public ConfigItemCategoryDO getById(Long id) {
|
||||
return configItemCategoryMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<ConfigItemCategoryVO> queryByCondition(String categoryName, Integer status) {
|
||||
return configItemCategoryMapper.queryByCondition(categoryName, status);
|
||||
}
|
||||
|
||||
public List<ConfigItemCategoryBaseInfoVO> queryAllList() {
|
||||
return configItemCategoryMapper.queryAllActiveList();
|
||||
}
|
||||
|
||||
public Map<String,String> queryAllListMap() {
|
||||
List<ConfigItemCategoryBaseInfoVO> configItemBaseInfoVOS = configItemCategoryMapper.queryAllActiveList();
|
||||
if (CollectionUtils.isEmpty(configItemBaseInfoVOS)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
return configItemCategoryMapper.queryAllActiveList().stream()
|
||||
.filter(v -> StringUtils.isNotBlank(v.getCategoryCode()))
|
||||
.collect(Collectors.toMap(ConfigItemCategoryBaseInfoVO::getCategoryCode, ConfigItemCategoryBaseInfoVO::getCategoryName, (a, b) -> a));
|
||||
}
|
||||
|
||||
public boolean softDeleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
ConfigItemCategoryDO update = new ConfigItemCategoryDO();
|
||||
update.setIsDeleted(1);
|
||||
Example example = new Example(ConfigItemCategoryDO.class);
|
||||
example.createCriteria().andIn("id", ids).andEqualTo("isDeleted", 0);
|
||||
return configItemCategoryMapper.updateByExampleSelective(update, example) > 0;
|
||||
}
|
||||
|
||||
public Map<String,String> nameMap(List<String> codeList) {
|
||||
if (CollectionUtils.isEmpty(codeList)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
Example example = new Example(ConfigItemCategoryDO.class);
|
||||
example.createCriteria().andIn("categoryCode", codeList).andEqualTo("isDeleted", 0);
|
||||
return configItemCategoryMapper.selectByExample( example).stream()
|
||||
.filter(v -> StringUtils.isNotBlank(v.getCategoryCode()))
|
||||
.collect(Collectors.toMap(ConfigItemCategoryDO::getCategoryCode, ConfigItemCategoryDO::getCategoryName, (a, b) -> a));
|
||||
}
|
||||
|
||||
|
||||
public boolean existsCode(Integer code, Long excludeId) {
|
||||
if (code == null) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigItemCategoryDO.class);
|
||||
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", code).andEqualTo("isDeleted", 0);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configItemCategoryMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public boolean existsSortNo(Integer sortNo, Long excludeId) {
|
||||
if (sortNo == null) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigItemCategoryDO.class);
|
||||
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", sortNo).andEqualTo("isDeleted", 0);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configItemCategoryMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.cool.store.dao.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigItemCategoryDO;
|
||||
import com.cool.store.entity.config.ConfigItemDO;
|
||||
import com.cool.store.mapper.config.ConfigItemMapper;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigItemDAO {
|
||||
|
||||
private final ConfigItemMapper configItemMapper;
|
||||
|
||||
public boolean insertSelective(ConfigItemDO entity) {
|
||||
return configItemMapper.insertSelective(entity) > 0;
|
||||
}
|
||||
|
||||
public boolean updateSelective(ConfigItemDO entity) {
|
||||
return configItemMapper.updateByPrimaryKeySelective(entity) > 0;
|
||||
}
|
||||
|
||||
public ConfigItemDO getById(Long id) {
|
||||
return configItemMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<ConfigItemVO> queryByCondition(String itemName, String itemCode, Long categoryId, Integer status) {
|
||||
return configItemMapper.queryByCondition(itemName, itemCode, categoryId, status);
|
||||
}
|
||||
|
||||
public Map<String, String> queryAllActiveMap() {
|
||||
List<ConfigItemBaseInfoVO> configItemBaseInfoVOS = configItemMapper.queryAllActiveList();
|
||||
if (CollectionUtils.isEmpty(configItemBaseInfoVOS)){
|
||||
return new HashMap<>();
|
||||
}
|
||||
return configItemBaseInfoVOS.stream()
|
||||
.filter(v -> StringUtils.isNotBlank(v.getItemCode()))
|
||||
.collect(Collectors.toMap(ConfigItemBaseInfoVO::getItemCode, ConfigItemBaseInfoVO::getItemName, (a, b) -> a));
|
||||
}
|
||||
|
||||
public boolean softDeleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
ConfigItemDO update = new ConfigItemDO();
|
||||
update.setIsDeleted(1);
|
||||
Example example = new Example(ConfigItemDO.class);
|
||||
example.createCriteria().andIn("id", ids).andEqualTo("isDeleted", 0);
|
||||
return configItemMapper.updateByExampleSelective(update, example) > 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean existsItemCode(String code, Long excludeId) {
|
||||
if (StringUtil.isEmpty(code)) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigItemDO.class);
|
||||
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", code).andEqualTo("isDeleted", 0);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configItemMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public boolean existsSortNo(Integer sortNo, Long excludeId) {
|
||||
if (sortNo == null) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigItemDO.class);
|
||||
Example.Criteria criteria = example.createCriteria().andEqualTo("sortNo", sortNo).andEqualTo("isDeleted", 0);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configItemMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public int countByCategoryIds(List<Long> categoryIds) {
|
||||
if (CollectionUtils.isEmpty(categoryIds)) {
|
||||
return 0;
|
||||
}
|
||||
return configItemMapper.countByCategoryIds(categoryIds);
|
||||
}
|
||||
|
||||
public Map<String,String> nameMap(List<String> codeList) {
|
||||
if (CollectionUtils.isEmpty(codeList)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
Example example = new Example(ConfigItemDO.class);
|
||||
example.createCriteria().andIn("itemCode", codeList).andEqualTo("isDeleted", 0);
|
||||
return configItemMapper.selectByExample( example).stream()
|
||||
.filter(v -> StringUtils.isNotBlank(v.getItemCode()))
|
||||
.collect(Collectors.toMap(ConfigItemDO::getItemCode, ConfigItemDO::getItemName, (a, b) -> a));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.cool.store.dao.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigOptionDO;
|
||||
import com.cool.store.mapper.config.ConfigOptionMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 配置选项 DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigOptionDAO {
|
||||
private final ConfigOptionMapper configOptionMapper;
|
||||
|
||||
public boolean insertSelective(ConfigOptionDO option) {
|
||||
return configOptionMapper.insertSelective(option) > 0;
|
||||
}
|
||||
|
||||
public boolean updateSelective(ConfigOptionDO option) {
|
||||
return configOptionMapper.updateByPrimaryKeySelective(option) > 0;
|
||||
}
|
||||
|
||||
public ConfigOptionDO getById(Long id) {
|
||||
return configOptionMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public boolean deleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigOptionDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return configOptionMapper.deleteByExample(example) > 0;
|
||||
}
|
||||
|
||||
public List<ConfigOptionDO> query(String categoryCode, String itemCode, Integer active, String optionName) {
|
||||
Example example = new Example(ConfigOptionDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (Objects.nonNull(categoryCode)) {
|
||||
criteria.andEqualTo("categoryCode", categoryCode);
|
||||
}
|
||||
if (Objects.nonNull(itemCode)) {
|
||||
criteria.andEqualTo("itemCode", itemCode);
|
||||
}
|
||||
if (Objects.nonNull(active)) {
|
||||
criteria.andEqualTo("active", active);
|
||||
}
|
||||
if (Objects.nonNull(optionName) && !optionName.trim().isEmpty()) {
|
||||
criteria.andLike("optionName", "%" + optionName.trim() + "%");
|
||||
}
|
||||
example.setOrderByClause("sort_order ASC");
|
||||
return configOptionMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<ConfigOptionDO> listActiveByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return configOptionMapper.listActiveByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验排序是否已存在(全局唯一,不区分类型/配置项)
|
||||
* @param sortOrder 排序值
|
||||
* @param excludeId 排除自身ID(新增传 null;修改传当前ID)
|
||||
*/
|
||||
public boolean existsSortOrder(Integer sortOrder, Long excludeId) {
|
||||
if (sortOrder == null) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigOptionDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("sortOrder", sortOrder);
|
||||
criteria.andEqualTo("active", 1);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configOptionMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public boolean existsOptionName(String optionName, Long excludeId) {
|
||||
if (optionName == null || optionName.trim().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(ConfigOptionDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("optionName", optionName.trim());
|
||||
criteria.andEqualTo("active", 1);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return configOptionMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.cool.store.entity.fees.FeeStandardConfigDO;
|
||||
import com.cool.store.mapper.fees.FeeStandardConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 加盟费用标准收费额配置DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class FeeStandardConfigDAO {
|
||||
|
||||
private final FeeStandardConfigMapper feeStandardConfigMapper;
|
||||
|
||||
public FeeStandardConfigDO selectByPrimaryKey(Long id) {
|
||||
return feeStandardConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public void insertSelective(FeeStandardConfigDO config) {
|
||||
feeStandardConfigMapper.insertSelective(config);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(FeeStandardConfigDO config) {
|
||||
feeStandardConfigMapper.updateByPrimaryKeySelective(config);
|
||||
}
|
||||
|
||||
public boolean existJoinBrandAndExpenseType(Integer joinBrand, String expenseType, Long excludeId) {
|
||||
Example example = new Example(FeeStandardConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andEqualTo("expenseType", expenseType);
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return feeStandardConfigMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public List<FeeStandardConfigDO> selectByCondition(Integer joinBrand, String expenseType) {
|
||||
Example example = new Example(FeeStandardConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (joinBrand != null) {
|
||||
criteria.andEqualTo("joinBrand", joinBrand);
|
||||
}
|
||||
if (StringUtils.isNotBlank(expenseType)) {
|
||||
criteria.andEqualTo("expenseType", expenseType.trim());
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return feeStandardConfigMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据品牌查询费用标准收费额配置映射
|
||||
* @param joinBrand 品牌
|
||||
* @return 费用类型 -> 收费额配置
|
||||
*/
|
||||
public Map<String, FeeStandardConfigDO> getStandardConfigMap(Integer joinBrand) {
|
||||
FeeStandardConfigDO configDO = new FeeStandardConfigDO();
|
||||
configDO.setJoinBrand(joinBrand);
|
||||
List<FeeStandardConfigDO> list = feeStandardConfigMapper.select(configDO);
|
||||
return CollStreamUtil.toMap(list, FeeStandardConfigDO::getExpenseType, v -> v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import com.cool.store.entity.fees.PayeeBankConfigDO;
|
||||
import com.cool.store.mapper.fees.PayeeBankConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 线下收款银行配置DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class PayeeBankConfigDAO {
|
||||
private final PayeeBankConfigMapper payeeBankConfigMapper;
|
||||
|
||||
public void insertSelective(PayeeBankConfigDO config) {
|
||||
payeeBankConfigMapper.insertSelective(config);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(PayeeBankConfigDO config) {
|
||||
payeeBankConfigMapper.updateByPrimaryKeySelective(config);
|
||||
}
|
||||
|
||||
public PayeeBankConfigDO selectByPrimaryKey(Long id) {
|
||||
return payeeBankConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public boolean existUniqueKey(Integer joinBrand, Long investDivisionId, Integer payType, Long excludeId) {
|
||||
Example example = new Example(PayeeBankConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andEqualTo("investDivisionId", investDivisionId)
|
||||
.andEqualTo("payType", payType);
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return payeeBankConfigMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同品牌同支付方式:只能存在“全部(0)”或“分部”其中一种
|
||||
*/
|
||||
public boolean existOtherInvestType(Integer joinBrand, Integer payType, Long investDivisionId, Long excludeId) {
|
||||
Example example = new Example(PayeeBankConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andEqualTo("payType", payType);
|
||||
if (Long.valueOf(0).equals(investDivisionId)) {
|
||||
criteria.andNotEqualTo("investDivisionId", 0L);
|
||||
} else {
|
||||
criteria.andEqualTo("investDivisionId", 0L);
|
||||
}
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return payeeBankConfigMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
public List<PayeeBankConfigDO> selectByCondition(Integer joinBrand, Long investDivisionId, Integer payType) {
|
||||
Example example = new Example(PayeeBankConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (joinBrand != null) {
|
||||
criteria.andEqualTo("joinBrand", joinBrand);
|
||||
}
|
||||
if (investDivisionId != null) {
|
||||
criteria.andEqualTo("investDivisionId", investDivisionId);
|
||||
}
|
||||
if (payType != null) {
|
||||
criteria.andEqualTo("payType", payType);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return payeeBankConfigMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据加盟品牌、加盟分部、支付方式查询配置
|
||||
* @param joinBrand 加盟品牌
|
||||
* @param investDivisionId 加盟分部
|
||||
* @param payType 支付方式
|
||||
* @return 配置
|
||||
*/
|
||||
public PayeeBankConfigDO getByUniqueKey(Integer joinBrand, Long investDivisionId, Integer payType) {
|
||||
Example example = new Example(PayeeBankConfigDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andIn("investDivisionId", Arrays.asList(investDivisionId, 0L))
|
||||
.andEqualTo("payType", payType);
|
||||
return payeeBankConfigMapper.selectOneByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import com.cool.store.entity.fees.ShopAllocationInfoDO;
|
||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||
import com.cool.store.mapper.fees.ShopAllocationInfoMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店平安钱包分账信息DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/1/29
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ShopAllocationInfoDAO {
|
||||
private final ShopAllocationInfoMapper shopAllocationInfoMapper;
|
||||
|
||||
public List<ShopAllocationInfoDO> getByShopId(Long shopId) {
|
||||
ShopAllocationInfoDO info = new ShopAllocationInfoDO();
|
||||
info.setShopId(shopId);
|
||||
return shopAllocationInfoMapper.select(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
public void insertBatch(List<ShopAllocationInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
shopAllocationInfoMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
public void updateBatch(List<ShopAllocationInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
shopAllocationInfoMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
public void insertOrUpdateBatch(List<ShopAllocationInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
for (ShopAllocationInfoDO shopAllocationInfoDO : list) {
|
||||
if (Objects.isNull(shopAllocationInfoDO.getStatus())) {
|
||||
shopAllocationInfoDO.setStatus(AllocationPayStatusEnum.PAYING.getStatus());
|
||||
}
|
||||
}
|
||||
shopAllocationInfoMapper.insertOrUpdateBatch(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.cool.store.entity.fees.WalletAllocationCompanyDO;
|
||||
import com.cool.store.mapper.fees.WalletAllocationCompanyMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 平安钱包分账公司配置DAO
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class WalletAllocationCompanyDAO {
|
||||
private final WalletAllocationCompanyMapper walletAllocationCompanyMapper;
|
||||
|
||||
public void insertSelective(WalletAllocationCompanyDO company) {
|
||||
walletAllocationCompanyMapper.insertSelective(company);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
public void insertBatch(List<WalletAllocationCompanyDO> list) {
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
walletAllocationCompanyMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(WalletAllocationCompanyDO company) {
|
||||
walletAllocationCompanyMapper.updateByPrimaryKeySelective(company);
|
||||
}
|
||||
|
||||
public WalletAllocationCompanyDO selectByPrimaryKey(Long id) {
|
||||
return walletAllocationCompanyMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public void deleteByPrimaryKey(Long id) {
|
||||
walletAllocationCompanyMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分账配置id查询公司列表
|
||||
*/
|
||||
public List<WalletAllocationCompanyDO> selectByConfigId(Long configId) {
|
||||
Example example = new Example(WalletAllocationCompanyDO.class);
|
||||
example.createCriteria().andEqualTo("configId", configId);
|
||||
return walletAllocationCompanyMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置id列表查询收款公司映射
|
||||
*/
|
||||
public Map<Long, List<WalletAllocationCompanyDO>> selectGroupByConfigIds(List<Long> configIds) {
|
||||
if (CollectionUtils.isEmpty(configIds)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Example example = new Example(WalletAllocationCompanyDO.class);
|
||||
example.createCriteria().andIn("configId", configIds);
|
||||
List<WalletAllocationCompanyDO> list = walletAllocationCompanyMapper.selectByExample(example);
|
||||
return CollStreamUtil.groupByKey(list, WalletAllocationCompanyDO::getConfigId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据收款公司code查询(用于分页查询条件)
|
||||
*/
|
||||
public List<WalletAllocationCompanyDO> selectByPayeeCode(String payeeCode) {
|
||||
Example example = new Example(WalletAllocationCompanyDO.class);
|
||||
example.createCriteria().andEqualTo("payeeCode", payeeCode);
|
||||
return walletAllocationCompanyMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置id删除
|
||||
*/
|
||||
public void deleteByConfigId(Long configId) {
|
||||
WalletAllocationCompanyDO companyDO = new WalletAllocationCompanyDO();
|
||||
companyDO.setConfigId(configId);
|
||||
walletAllocationCompanyMapper.delete(companyDO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import com.cool.store.entity.fees.WalletAllocationConfigDO;
|
||||
import com.cool.store.mapper.fees.WalletAllocationConfigMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 平安钱包分账配置DAO
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class WalletAllocationConfigDAO {
|
||||
private final WalletAllocationConfigMapper walletAllocationConfigMapper;
|
||||
|
||||
public void insertSelective(WalletAllocationConfigDO config) {
|
||||
walletAllocationConfigMapper.insertSelective(config);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(WalletAllocationConfigDO config) {
|
||||
walletAllocationConfigMapper.updateByPrimaryKeySelective(config);
|
||||
}
|
||||
|
||||
public WalletAllocationConfigDO selectByPrimaryKey(Long id) {
|
||||
return walletAllocationConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据加盟品牌、招商分部、费用类型查询
|
||||
*/
|
||||
public Boolean existUniqueKey(Integer joinBrand, Long investDivisionId, String expenseType, Long excludeId) {
|
||||
Example example = new Example(WalletAllocationConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andEqualTo("investDivisionId", investDivisionId)
|
||||
.andEqualTo("expenseType", expenseType);
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return walletAllocationConfigMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据加盟品牌、招商分部查询
|
||||
* @param joinBrand 家门品牌
|
||||
* @param investDivisionId 招商分部id
|
||||
* @return 配置列表
|
||||
*/
|
||||
public List<WalletAllocationConfigDO> selectByBrandAndInvest(Integer joinBrand, Long investDivisionId) {
|
||||
Example example = new Example(WalletAllocationConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andIn("investDivisionId", Arrays.asList(investDivisionId, 0L));
|
||||
return walletAllocationConfigMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
public List<WalletAllocationConfigDO> selectByCondition(Integer joinBrand, Long investDivisionId, Integer expenseType, List<Long> configIds) {
|
||||
Example example = new Example(WalletAllocationConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (joinBrand != null) {
|
||||
criteria.andEqualTo("joinBrand", joinBrand);
|
||||
}
|
||||
if (investDivisionId != null) {
|
||||
criteria.andEqualTo("investDivisionId", investDivisionId);
|
||||
}
|
||||
if (expenseType != null) {
|
||||
criteria.andEqualTo("expenseType", expenseType);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(configIds)) {
|
||||
criteria.andIn("id", configIds);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return walletAllocationConfigMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在其他分部类型
|
||||
*/
|
||||
public boolean existOtherInvestType(Integer joinBrand, String expenseType, Long investDivisionId, Long excludeId) {
|
||||
Example example = new Example(WalletAllocationConfigDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("joinBrand", joinBrand)
|
||||
.andEqualTo("expenseType", expenseType);
|
||||
if (Long.valueOf(0).equals(investDivisionId)) {
|
||||
criteria.andNotEqualTo("investDivisionId", 0);
|
||||
} else {
|
||||
criteria.andEqualTo("investDivisionId", 0);
|
||||
}
|
||||
if (Objects.nonNull(excludeId)) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return walletAllocationConfigMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.cool.store.dao.fees;
|
||||
|
||||
import com.cool.store.entity.fees.WalletPayInfoDO;
|
||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||
import com.cool.store.mapper.fees.WalletPayInfoMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包加盟缴费信息DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/1/30
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class WalletPayInfoDAO {
|
||||
private final WalletPayInfoMapper walletPayInfoMapper;
|
||||
|
||||
/**
|
||||
* 是否存在缴费信息
|
||||
* @param shopId 门店id
|
||||
* @return 是否存在
|
||||
*/
|
||||
public boolean existPayInfo(Long shopId) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria().andEqualTo("shopId", shopId);
|
||||
return walletPayInfoMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
public void insertBatch(List<WalletPayInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
walletPayInfoMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据payNo编辑
|
||||
*/
|
||||
public void updateByPayNo(WalletPayInfoDO walletPayInfoDO) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria().andEqualTo("payNo", walletPayInfoDO.getPayNo());
|
||||
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据门店id查询
|
||||
*/
|
||||
public List<WalletPayInfoDO> getByShopId(Long shopId, String module, Integer payStatus) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("shopId", shopId)
|
||||
.andEqualTo("module", module);
|
||||
if (Objects.nonNull(payStatus)) {
|
||||
criteria.andEqualTo("payStatus", payStatus);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return walletPayInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据门店查询已支付
|
||||
*/
|
||||
public List<WalletPayInfoDO> getPaidByShopId(Long shopId, String module) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("shopId", shopId)
|
||||
.andEqualTo("module", module)
|
||||
.andEqualTo("payStatus", AllocationPayStatusEnum.PAID.getStatus());
|
||||
example.setOrderByClause("create_time ASC");
|
||||
return walletPayInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public WalletPayInfoDO getById(Long id) {
|
||||
return walletPayInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据付款单号查询
|
||||
*/
|
||||
public WalletPayInfoDO getByPayNo(String payNo) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria().andEqualTo("payNo", payNo);
|
||||
return walletPayInfoMapper.selectOneByExample(example);
|
||||
}
|
||||
|
||||
public List<WalletPayInfoDO> getByPayNoList(List<String> payNoList) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria().andIn("payNo", payNoList);
|
||||
return walletPayInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(WalletPayInfoDO walletPayInfoDO) {
|
||||
walletPayInfoMapper.updateByPrimaryKeySelective(walletPayInfoDO);
|
||||
}
|
||||
|
||||
public boolean updateBatchByPayNo(List<WalletPayInfoDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return walletPayInfoMapper.updateBatchByPayNo(list) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据付款单号修改认领状态
|
||||
* @param payNo 付款单号
|
||||
* @param claimStatus 认领状态 0未认领1已认领
|
||||
* @return 是否成功
|
||||
*/
|
||||
public void updateClaimStatusByPayNo(String payNo, Integer claimStatus) {
|
||||
Example example = new Example(WalletPayInfoDO.class);
|
||||
example.createCriteria().andEqualTo("payNo", payNo);
|
||||
WalletPayInfoDO walletPayInfoDO = new WalletPayInfoDO();
|
||||
walletPayInfoDO.setClaimStatus(claimStatus);
|
||||
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.cool.store.dao.modify;
|
||||
|
||||
import com.cool.store.entity.modify.ModifyRecordDO;
|
||||
import com.cool.store.enums.BusinessModuleEnum;
|
||||
import com.cool.store.mapper.modify.ModifyRecordMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务修改记录DAO
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ModifyRecordDAO {
|
||||
private final ModifyRecordMapper modifyRecordMapper;
|
||||
|
||||
/**
|
||||
* 新增修改记录
|
||||
* @param module 业务模块
|
||||
* @param businessId 业务id
|
||||
* @param updateUserId 更新人id
|
||||
*/
|
||||
public void insertRecord(BusinessModuleEnum module, Long businessId, String updateUserId) {
|
||||
ModifyRecordDO modifyRecord = new ModifyRecordDO(null, module.getCode(), businessId, updateUserId, null);
|
||||
modifyRecordMapper.insertSelective(modifyRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模块及业务id查询
|
||||
* @param module 模块code
|
||||
* @param businessId 业务id
|
||||
* @return 记录列表
|
||||
*/
|
||||
public List<ModifyRecordDO> getListByBusinessId(String module, Long businessId) {
|
||||
Example example = new Example(ModifyRecordDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("module", module)
|
||||
.andEqualTo("businessId", businessId);
|
||||
example.setOrderByClause("update_time desc");
|
||||
return modifyRecordMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.dao.order;
|
||||
|
||||
import com.cool.store.entity.order.PreAllocationRecordDO;
|
||||
import com.cool.store.mapper.order.PreAllocationRecordMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class PreAllocationRecordDAO {
|
||||
|
||||
private final PreAllocationRecordMapper preAllocationRecordMapper;
|
||||
|
||||
public boolean insertSelective(PreAllocationRecordDO record) {
|
||||
return preAllocationRecordMapper.insertSelective(record) > 0;
|
||||
}
|
||||
|
||||
public PreAllocationRecordDO getById(Long id) {
|
||||
return preAllocationRecordMapper.getById(id);
|
||||
}
|
||||
|
||||
public List<PreAllocationRecordDO> queryPageByOrderId(Long orderId) {
|
||||
return preAllocationRecordMapper.queryPageByOrderId(orderId);
|
||||
}
|
||||
|
||||
public List<PreAllocationRecordDO> queryPageByShopId(Long shopId) {
|
||||
return preAllocationRecordMapper.queryPageByShopId(shopId);
|
||||
}
|
||||
|
||||
public List<PreAllocationRecordDO> queryPageByPayNo(String payNo) {
|
||||
return preAllocationRecordMapper.queryPageByPayNo(payNo);
|
||||
}
|
||||
|
||||
public boolean updateStatus(Long id, Integer status) {
|
||||
return preAllocationRecordMapper.updateStatus(id, status) > 0;
|
||||
}
|
||||
|
||||
public boolean deleteByShopId(Long shopId) {
|
||||
return preAllocationRecordMapper.deleteByShopId(shopId) > 0;
|
||||
}
|
||||
|
||||
public boolean insertBatch(List<PreAllocationRecordDO> list) {
|
||||
return preAllocationRecordMapper.insertBatch(list) > 0;
|
||||
}
|
||||
|
||||
public boolean updateBatch(List<PreAllocationRecordDO> list) {
|
||||
return preAllocationRecordMapper.updateBatch(list) > 0;
|
||||
}
|
||||
|
||||
public boolean updateByOrderId(Long orderId) {
|
||||
return preAllocationRecordMapper.updateByOrderId(orderId) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.cool.store.dao.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreOrderDO;
|
||||
import com.cool.store.mapper.order.StoreOrderMapper;
|
||||
import com.cool.store.request.order.PCStoreOrderQueryRequest;
|
||||
import com.cool.store.vo.order.PCStoreOrderListVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreOrderDAO {
|
||||
|
||||
private final StoreOrderMapper storeOrderMapper;
|
||||
|
||||
public boolean insertSelective(StoreOrderDO order) {
|
||||
return storeOrderMapper.insertSelective(order) > 0;
|
||||
}
|
||||
|
||||
public StoreOrderDO getById(Long id) {
|
||||
return storeOrderMapper.getById(id);
|
||||
}
|
||||
|
||||
public List<StoreOrderDO> queryPage(Long shopId, Integer status) {
|
||||
return storeOrderMapper.queryPage(shopId, status);
|
||||
}
|
||||
|
||||
public List<StoreOrderDO> queryPageByLineId(Long lineId, Integer status) {
|
||||
return storeOrderMapper.queryPageByLineId(lineId, status);
|
||||
}
|
||||
|
||||
public List<PCStoreOrderListVO> queryPCPage(PCStoreOrderQueryRequest request) {
|
||||
return storeOrderMapper.queryPCPage(request);
|
||||
}
|
||||
|
||||
public Long count(PCStoreOrderQueryRequest request) {
|
||||
return storeOrderMapper.count(request);
|
||||
}
|
||||
|
||||
public boolean updateSelective(StoreOrderDO order) {
|
||||
return storeOrderMapper.updateByPrimaryKeySelective(order) > 0;
|
||||
}
|
||||
|
||||
public boolean existsUnfinishedOrder(Long shopId, List<Integer> statuses) {
|
||||
if (shopId == null || statuses == null || statuses.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return storeOrderMapper.countByShopIdAndStatusIn(shopId, statuses) > 0;
|
||||
}
|
||||
|
||||
public boolean existsPaidOrder(Long shopId, Integer status) {
|
||||
if (shopId == null || status == null) {
|
||||
return false;
|
||||
}
|
||||
return storeOrderMapper.countByShopIdAndStatus(shopId, status) > 0;
|
||||
}
|
||||
|
||||
public StoreOrderDO getLatestByShopIdAndStatus(Long shopId, Integer status) {
|
||||
if (shopId == null || status == null) {
|
||||
return null;
|
||||
}
|
||||
return storeOrderMapper.getLatestDraftByShopId(shopId, status);
|
||||
}
|
||||
|
||||
public StoreOrderDO getLatestOrderByShopId(Long shopId) {
|
||||
if (shopId == null ) {
|
||||
return null;
|
||||
}
|
||||
return storeOrderMapper.getLatestOrderByShopId(shopId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.cool.store.dao.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
|
||||
import com.cool.store.mapper.order.StoreOrderOptionSnapshotMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreOrderOptionSnapshotDAO {
|
||||
|
||||
private final StoreOrderOptionSnapshotMapper mapper;
|
||||
|
||||
public boolean insertBatch(List<StoreOrderOptionSnapshotDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return mapper.insertBatch(list) > 0;
|
||||
}
|
||||
|
||||
public List<StoreOrderOptionSnapshotDO> listByOrderId(Long orderId) {
|
||||
if (orderId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mapper.listByOrderId(orderId);
|
||||
}
|
||||
|
||||
public boolean deleteByOrderId(Long orderId) {
|
||||
if (orderId == null) {
|
||||
return false;
|
||||
}
|
||||
return mapper.deleteByOrderId(orderId) > 0;
|
||||
}
|
||||
|
||||
public boolean updateSelective(StoreOrderOptionSnapshotDO snapshotDO) {
|
||||
if (snapshotDO == null || snapshotDO.getId() == null) {
|
||||
return false;
|
||||
}
|
||||
return mapper.updateByPrimaryKeySelective(snapshotDO) > 0;
|
||||
}
|
||||
|
||||
public void batchUpdateQuantityAndAmount(@Param("list") List<StoreOrderOptionSnapshotDO> list){
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return;
|
||||
}
|
||||
mapper.batchUpdateQuantityAndAmount(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.cool.store.dao.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreWishlistDO;
|
||||
import com.cool.store.mapper.order.StoreWishlistMapper;
|
||||
import com.cool.store.vo.order.MiniStoreWishlistListVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreWishlistDAO {
|
||||
|
||||
private final StoreWishlistMapper mapper;
|
||||
|
||||
public boolean insertBatch(List<StoreWishlistDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return mapper.insertBatch(list) > 0;
|
||||
}
|
||||
|
||||
public boolean softDeleteByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
||||
if (lineId == null || storeTypeId == null || versionNo == null) {
|
||||
return false;
|
||||
}
|
||||
return mapper.softDeleteByLineIdAndStoreTypeAndVersion(lineId, storeTypeId, versionNo) > 0;
|
||||
}
|
||||
|
||||
public StoreWishlistDO getById(Long id) {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
return mapper.getById(id);
|
||||
}
|
||||
|
||||
public List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(Long lineId, Long storeTypeId, String versionNo) {
|
||||
if (lineId == null || storeTypeId == null || versionNo == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mapper.listByLineIdAndStoreTypeAndVersion(lineId, storeTypeId, versionNo);
|
||||
}
|
||||
|
||||
public List<MiniStoreWishlistListVO> listByLineId(Long lineId, Long storeTypeId) {
|
||||
if (lineId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mapper.listByLineId(lineId, storeTypeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.cool.store.dao.store;
|
||||
|
||||
import com.cool.store.entity.store.StoreTypeDO;
|
||||
import com.cool.store.mapper.store.StoreTypeMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店型 DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreTypeDAO {
|
||||
private final StoreTypeMapper storeTypeMapper;
|
||||
|
||||
/** 新增 */
|
||||
public boolean insertSelective(StoreTypeDO storeTypeDO) {
|
||||
return storeTypeMapper.insertSelective(storeTypeDO) > 0;
|
||||
}
|
||||
|
||||
/** 编辑 */
|
||||
public boolean updateSelective(StoreTypeDO storeTypeDO) {
|
||||
return storeTypeMapper.updateByPrimaryKeySelective(storeTypeDO) > 0;
|
||||
}
|
||||
|
||||
/** 根据主键查询 */
|
||||
public StoreTypeDO getById(Long id) {
|
||||
return storeTypeMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/** 根据编码查询 */
|
||||
public StoreTypeDO getByCode(String code) {
|
||||
return storeTypeMapper.selectOne(StoreTypeDO.builder().storeTypeCode(code).build());
|
||||
}
|
||||
|
||||
/** 批量删除(物理删除,谨慎使用) */
|
||||
public boolean deleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(StoreTypeDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return storeTypeMapper.deleteByExample(example) > 0;
|
||||
}
|
||||
|
||||
public List<StoreTypeDO> selectByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(StoreTypeDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return storeTypeMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 软删除:deleted=true
|
||||
*/
|
||||
public boolean softDeleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return false;
|
||||
}
|
||||
StoreTypeDO update = new StoreTypeDO();
|
||||
update.setDeleted(true);
|
||||
Example example = new Example(StoreTypeDO.class);
|
||||
example.createCriteria().andIn("id", ids);
|
||||
return storeTypeMapper.updateByExampleSelective(update, example) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用
|
||||
*/
|
||||
public boolean updateActiveById(Long id, Boolean active) {
|
||||
if (id == null) {
|
||||
return false;
|
||||
}
|
||||
StoreTypeDO update = new StoreTypeDO();
|
||||
update.setId(id);
|
||||
update.setActive(active);
|
||||
return storeTypeMapper.updateByPrimaryKeySelective(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页/条件查询
|
||||
* @param keyword 名称/编码模糊
|
||||
* @param active 是否启用
|
||||
* @param brand 品牌精准
|
||||
*/
|
||||
public List<StoreTypeDO> queryByCondition(String keyword, Boolean active, String brand) {
|
||||
return storeTypeMapper.queryByCondition(keyword, active, brand);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据门店类型查询启用的店型
|
||||
*/
|
||||
public List<StoreTypeDO> listActiveByStoreType(Integer storeType) {
|
||||
return storeTypeMapper.listByStoreType(storeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验排序是否已存在(全局唯一)
|
||||
*/
|
||||
public boolean existsSortOrder(Integer sortOrder, Long excludeId) {
|
||||
if (sortOrder == null) {
|
||||
return false;
|
||||
}
|
||||
Example example = new Example(StoreTypeDO.class);
|
||||
Example.Criteria criteria = example.createCriteria().andEqualTo("sortOrder", sortOrder);
|
||||
criteria.andEqualTo("deleted", 1);
|
||||
if (excludeId != null) {
|
||||
criteria.andNotEqualTo("id", excludeId);
|
||||
}
|
||||
return storeTypeMapper.selectCountByExample(example) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.cool.store.dao.store;
|
||||
|
||||
import com.cool.store.entity.CloseStoreAuditRecordDO;
|
||||
import com.cool.store.entity.store.StoreTypeDO;
|
||||
import com.cool.store.entity.store.StoreTypeOptionDO;
|
||||
import com.cool.store.enums.close.CloseStoreAuditStatusEnum;
|
||||
import com.cool.store.mapper.store.StoreTypeOptionMapper;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 店型-选项 DAO
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreTypeOptionDAO {
|
||||
private final StoreTypeOptionMapper mapper;
|
||||
|
||||
public boolean insertBatchSelective(List<StoreTypeOptionDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return mapper.insertBatch(list) > 0;
|
||||
}
|
||||
|
||||
public boolean deleteByStoreTypeId(Long storeTypeId) {
|
||||
return mapper.delete(StoreTypeOptionDO.builder().storeTypeId(storeTypeId).build()) > 0;
|
||||
}
|
||||
|
||||
public Integer softDeleteByStoreTypeId(List<Long> storeTypeIds){
|
||||
Example example = new Example(StoreTypeOptionDO.class);
|
||||
StoreTypeOptionDO update = new StoreTypeOptionDO();
|
||||
update.setVisible(1);
|
||||
example.createCriteria()
|
||||
.andIn("storeTypeId", storeTypeIds);
|
||||
return mapper.updateByExampleSelective(update,example);
|
||||
}
|
||||
|
||||
public List<StoreTypeOptionDO> listByStoreTypeId(Long storeTypeId) {
|
||||
return mapper.select(StoreTypeOptionDO.builder().storeTypeId(storeTypeId).build());
|
||||
}
|
||||
|
||||
public List<StoreTypeOptionDO> query(Long storeTypeId, String itemCode) {
|
||||
Example example = new Example(StoreTypeOptionDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (Objects.nonNull(storeTypeId)) {
|
||||
criteria.andEqualTo("storeTypeId", storeTypeId);
|
||||
}
|
||||
if (Objects.nonNull(itemCode)) {
|
||||
criteria.andEqualTo("itemCode", itemCode);
|
||||
}
|
||||
return mapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public int countByOptionId(Long optionId) {
|
||||
if (optionId == null) {
|
||||
return 0;
|
||||
}
|
||||
Example example = new Example(StoreTypeOptionDO.class);
|
||||
example.createCriteria().andEqualTo("optionId", optionId).andEqualTo("visible",0);
|
||||
return mapper.selectCountByExample(example);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.dao.visit;
|
||||
|
||||
import com.cool.store.entity.visit.StoreVisitReservationDO;
|
||||
import com.cool.store.mapper.visit.StoreVisitReservationMapper;
|
||||
import com.cool.store.request.visit.StoreVisitReservationAdminQueryRequest;
|
||||
import com.cool.store.vo.visit.StoreVisitReservationVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreVisitReservationDAO {
|
||||
|
||||
private final StoreVisitReservationMapper storeVisitReservationMapper;
|
||||
|
||||
public Boolean insertSelective(StoreVisitReservationDO reservationDO) {
|
||||
return storeVisitReservationMapper.insertSelective(reservationDO) > 0;
|
||||
}
|
||||
|
||||
public Boolean updateSelective(StoreVisitReservationDO reservationDO) {
|
||||
return storeVisitReservationMapper.updateByPrimaryKeySelective(reservationDO) > 0;
|
||||
}
|
||||
|
||||
public StoreVisitReservationDO getById(Long id) {
|
||||
return storeVisitReservationMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<StoreVisitReservationDO> listByMobile(String mobile,Integer status) {
|
||||
Example example = new Example(StoreVisitReservationDO.class);
|
||||
Example.Criteria criteria = example.createCriteria()
|
||||
.andEqualTo("deleted", 0);
|
||||
if (StringUtils.isNotBlank(mobile)) {
|
||||
criteria.andEqualTo("mobile", mobile);
|
||||
}
|
||||
if (status!=null){
|
||||
criteria.andEqualTo("status",status);
|
||||
}
|
||||
example.setOrderByClause("create_time DESC");
|
||||
return storeVisitReservationMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<StoreVisitReservationVO> adminPage(StoreVisitReservationAdminQueryRequest request) {
|
||||
return storeVisitReservationMapper.adminPage(request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.cool.store.dao.wallet;
|
||||
|
||||
import com.cool.store.entity.wallet.WalletTradeDO;
|
||||
import com.cool.store.mapper.wallet.WalletTradeMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包交易单DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/2/4
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class WalletTradeDAO {
|
||||
private final WalletTradeMapper walletTradeMapper;
|
||||
|
||||
public void insertSelective(WalletTradeDO walletTradeDO) {
|
||||
walletTradeMapper.insertSelective(walletTradeDO);
|
||||
}
|
||||
|
||||
public void insertBatch(List<WalletTradeDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
walletTradeMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
public WalletTradeDO getByPayNo(String payNo) {
|
||||
Example example = new Example(WalletTradeDO.class);
|
||||
example.createCriteria().andEqualTo("payNo", payNo);
|
||||
return walletTradeMapper.selectOneByExample(example);
|
||||
}
|
||||
|
||||
public void updateByPrimaryKeySelective(WalletTradeDO walletTradeDO) {
|
||||
walletTradeMapper.updateByPrimaryKeySelective(walletTradeDO);
|
||||
}
|
||||
|
||||
public boolean updateByPayNo(WalletTradeDO record) {
|
||||
if (record == null || record.getPayNo() == null) {
|
||||
return false;
|
||||
}
|
||||
return walletTradeMapper.updateByPayNo(record) > 0;
|
||||
}
|
||||
|
||||
public boolean updateBatchByPayNo(List<WalletTradeDO> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return false;
|
||||
}
|
||||
return walletTradeMapper.updateBatchByPayNo(list) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.mapper.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigItemCategoryDO;
|
||||
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemCategoryVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ConfigItemCategoryMapper extends Mapper<ConfigItemCategoryDO> {
|
||||
|
||||
List<ConfigItemCategoryVO> queryByCondition(@Param("categoryName") String categoryName,
|
||||
@Param("status") Integer status);
|
||||
|
||||
List<ConfigItemCategoryBaseInfoVO> queryAllActiveList();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.mapper.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigItemDO;
|
||||
import com.cool.store.vo.config.ConfigItemBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO;
|
||||
import com.cool.store.vo.config.ConfigItemVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ConfigItemMapper extends Mapper<ConfigItemDO> {
|
||||
|
||||
List<ConfigItemVO> queryByCondition(@Param("itemName") String itemName,
|
||||
@Param("itemCode") String itemCode,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("status") Integer status);
|
||||
|
||||
List<ConfigItemBaseInfoVO> queryAllActiveList();
|
||||
|
||||
int countByCategoryIds(@Param("categoryIds") List<Long> categoryIds);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.mapper.config;
|
||||
|
||||
import com.cool.store.entity.config.ConfigOptionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ConfigOptionMapper extends Mapper<ConfigOptionDO> {
|
||||
|
||||
List<ConfigOptionDO> listActiveByIds(@Param("ids") List<Long> ids);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.FeeStandardConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface FeeStandardConfigMapper extends Mapper<FeeStandardConfigDO> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.PayeeBankConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface PayeeBankConfigMapper extends Mapper<PayeeBankConfigDO> {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.ShopAllocationInfoDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopAllocationInfoMapper extends Mapper<ShopAllocationInfoDO> {
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
void insertBatch(List<ShopAllocationInfoDO> list);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
*/
|
||||
void updateBatch(List<ShopAllocationInfoDO> list);
|
||||
|
||||
void insertOrUpdateBatch(List<ShopAllocationInfoDO> list);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.WalletAllocationCompanyDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WalletAllocationCompanyMapper extends Mapper<WalletAllocationCompanyDO> {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
void insertBatch(List<WalletAllocationCompanyDO> list);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.WalletAllocationConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface WalletAllocationConfigMapper extends Mapper<WalletAllocationConfigDO> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.mapper.fees;
|
||||
|
||||
import com.cool.store.entity.fees.WalletPayInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WalletPayInfoMapper extends Mapper<WalletPayInfoDO> {
|
||||
void insertBatch(List<WalletPayInfoDO> list);
|
||||
|
||||
int updateByPayNo(WalletPayInfoDO record);
|
||||
|
||||
int updateBatchByPayNo(@Param("list") List<WalletPayInfoDO> list);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.modify;
|
||||
|
||||
import com.cool.store.entity.modify.ModifyRecordDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface ModifyRecordMapper extends Mapper<ModifyRecordDO> {
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.mapper.order;
|
||||
|
||||
import com.cool.store.entity.order.PreAllocationRecordDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PreAllocationRecordMapper extends Mapper<PreAllocationRecordDO> {
|
||||
|
||||
PreAllocationRecordDO getById(@Param("id") Long id);
|
||||
|
||||
List<PreAllocationRecordDO> queryPageByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
List<PreAllocationRecordDO> queryPageByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
List<PreAllocationRecordDO> queryPageByPayNo(@Param("payNo") String payNo);
|
||||
|
||||
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
|
||||
|
||||
int deleteByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
int insertBatch(@Param("list") List<PreAllocationRecordDO> list);
|
||||
|
||||
int updateBatch(@Param("list") List<PreAllocationRecordDO> list);
|
||||
|
||||
int updateByOrderId(Long orderId);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.cool.store.mapper.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreOrderDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import com.cool.store.request.order.PCStoreOrderQueryRequest;
|
||||
import com.cool.store.vo.order.PCStoreOrderListVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreOrderMapper extends Mapper<StoreOrderDO> {
|
||||
|
||||
List<StoreOrderDO> queryPage(@Param("shopId") Long shopId,
|
||||
@Param("status") Integer status);
|
||||
|
||||
List<PCStoreOrderListVO> queryPCPage(PCStoreOrderQueryRequest request);
|
||||
|
||||
Long count(PCStoreOrderQueryRequest request);
|
||||
|
||||
List<StoreOrderDO> queryPageByLineId(@Param("lineId") Long lineId,
|
||||
@Param("status") Integer status);
|
||||
|
||||
StoreOrderDO getById(@Param("id") Long id);
|
||||
|
||||
StoreOrderDO getLatestDraftByShopId(@Param("shopId") Long shopId,
|
||||
@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 获取当前门店 最新的订单 除了已关闭的
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
StoreOrderDO getLatestOrderByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
int countByShopIdAndStatusIn(@Param("shopId") Long shopId,
|
||||
@Param("statuses") List<Integer> statuses);
|
||||
|
||||
int countByShopIdAndStatus(@Param("shopId") Long shopId,
|
||||
@Param("status") Integer status);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.mapper.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreOrderOptionSnapshotDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreOrderOptionSnapshotMapper extends Mapper<StoreOrderOptionSnapshotDO> {
|
||||
|
||||
int insertBatch(@Param("list") List<StoreOrderOptionSnapshotDO> list);
|
||||
|
||||
List<StoreOrderOptionSnapshotDO> listByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
int deleteByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
void batchUpdateQuantityAndAmount(@Param("list") List<StoreOrderOptionSnapshotDO> list);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.mapper.order;
|
||||
|
||||
import com.cool.store.entity.order.StoreWishlistDO;
|
||||
import com.cool.store.vo.order.MiniStoreWishlistListVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreWishlistMapper extends Mapper<StoreWishlistDO> {
|
||||
|
||||
int insertBatch(@Param("list") List<StoreWishlistDO> list);
|
||||
|
||||
int softDeleteByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
|
||||
@Param("storeTypeId") Long storeTypeId,
|
||||
@Param("versionNo") String versionNo);
|
||||
|
||||
StoreWishlistDO getById(@Param("id") Long id);
|
||||
|
||||
List<StoreWishlistDO> listByLineIdAndStoreTypeAndVersion(@Param("lineId") Long lineId,
|
||||
@Param("storeTypeId") Long storeTypeId,
|
||||
@Param("versionNo") String versionNo);
|
||||
|
||||
List<MiniStoreWishlistListVO> listByLineId(@Param("lineId") Long lineId,
|
||||
@Param("storeTypeId") Long storeTypeId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.cool.store.mapper.store;
|
||||
|
||||
import com.cool.store.entity.store.StoreTypeDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreTypeMapper extends Mapper<StoreTypeDO> {
|
||||
|
||||
List<StoreTypeDO> queryByCondition(@Param("keyword") String keyword,
|
||||
@Param("active") Boolean active,
|
||||
@Param("brand") String brand);
|
||||
|
||||
List<StoreTypeDO> listByStoreType(@Param("storeType") Integer storeType);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.mapper.store;
|
||||
|
||||
import com.cool.store.entity.store.StoreTypeOptionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreTypeOptionMapper extends Mapper<StoreTypeOptionDO> {
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
int insertBatch(@Param("list") List<StoreTypeOptionDO> list);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.cool.store.mapper.visit;
|
||||
|
||||
import com.cool.store.entity.visit.StoreVisitReservationDO;
|
||||
import com.cool.store.request.visit.StoreVisitReservationAdminQueryRequest;
|
||||
import com.cool.store.vo.visit.StoreVisitReservationVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreVisitReservationMapper extends Mapper<StoreVisitReservationDO> {
|
||||
|
||||
List<StoreVisitReservationVO> adminPage(@Param("request") StoreVisitReservationAdminQueryRequest request);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.mapper.wallet;
|
||||
|
||||
import com.cool.store.entity.wallet.WalletTradeDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WalletTradeMapper extends Mapper<WalletTradeDO> {
|
||||
void insertBatch(List<WalletTradeDO> list);
|
||||
|
||||
int updateByPayNo(WalletTradeDO record);
|
||||
|
||||
int updateBatchByPayNo(@Param("list") List<WalletTradeDO> list);
|
||||
}
|
||||
@@ -134,6 +134,9 @@
|
||||
<if test="param.franchiseBrand != null">
|
||||
franchise_brand,
|
||||
</if>
|
||||
<if test="param.useStandardStore != null">
|
||||
use_standard_store,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="param.id != null and param.id != ''">
|
||||
@@ -230,7 +233,10 @@
|
||||
#{param.partnerNum},
|
||||
</if>
|
||||
<if test="param.franchiseBrand != null">
|
||||
#{param.franchiseBrand}
|
||||
#{param.franchiseBrand},
|
||||
</if>
|
||||
<if test="param.useStandardStore != null">
|
||||
#{param.useStandardStore}
|
||||
</if>
|
||||
</trim>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
@@ -326,7 +332,10 @@
|
||||
partner_num = #{param.partnerNum},
|
||||
</if>
|
||||
<if test="param.franchiseBrand != null">
|
||||
franchise_brand = #{param.franchiseBrand}
|
||||
franchise_brand = #{param.franchiseBrand},
|
||||
</if>
|
||||
<if test="param.useStandardStore != null">
|
||||
use_standard_store = #{param.useStandardStore}
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -58,11 +58,11 @@
|
||||
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name,
|
||||
store_num,supervisor_user_id,create_time,join_mode,franchise_brand,
|
||||
development_manager,want_shop_area_id,investment_manager,store_id,invest_region_id) values
|
||||
development_manager,want_shop_area_id,investment_manager,store_id,invest_region_id,use_standard_store) values
|
||||
<foreach collection="shopInfoList" item="shop" separator=",">
|
||||
(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName},
|
||||
#{shop.storeNum},#{shop.supervisorUserId},#{shop.createTime},#{shop.joinMode},#{shop.franchiseBrand},#{shop.developmentManager},
|
||||
#{shop.wantShopAreaId},#{shop.investmentManager},#{shop.storeId},#{shop.investRegionId})
|
||||
#{shop.wantShopAreaId},#{shop.investmentManager},#{shop.storeId},#{shop.investRegionId},#{shop.useStandardStore})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -318,7 +318,8 @@
|
||||
a.detail_address as shopAddress,
|
||||
a.manager_region_id as managerRegionId,
|
||||
a.store_id as storeId,
|
||||
a.invest_region_id as investRegionId
|
||||
a.invest_region_id as investRegionId,
|
||||
a.use_standard_store as useStandardStore
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
<if test="request.contractStartTime !=null and request.contractEndTime != null">
|
||||
left join xfsg_sign_franchise c on a.id = c.shop_id
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.config.ConfigItemCategoryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.config.ConfigItemCategoryDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="category_code" property="categoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
|
||||
<result column="sort_no" property="sortNo" jdbcType="INTEGER"/>
|
||||
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="created_user_id" property="createdUserId" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="updated_user_id" property="updatedUserId" jdbcType="VARCHAR"/>
|
||||
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="CategoryVOResultMap" type="com.cool.store.vo.config.ConfigItemCategoryVO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="category_code" property="categoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
|
||||
<result column="sort_no" property="sortNo" jdbcType="INTEGER"/>
|
||||
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="created_user_id" property="createdUserId" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="updated_user_id" property="updatedUserId" jdbcType="VARCHAR"/>
|
||||
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, category_code, category_name, sort_no, image_url, video_url,
|
||||
status, is_deleted, remark, created_user_id, created_time, updated_user_id, updated_time
|
||||
</sql>
|
||||
|
||||
<select id="queryByCondition" resultMap="CategoryVOResultMap">
|
||||
SELECT id, category_code, category_name, sort_no, image_url, video_url,
|
||||
status, remark, created_user_id, created_time, updated_user_id, updated_time
|
||||
FROM zxjp_cfg_item_category
|
||||
WHERE is_deleted = 0
|
||||
<if test="categoryName != null and categoryName != ''">
|
||||
AND category_name LIKE CONCAT('%', #{categoryName}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
ORDER BY sort_no ASC, id DESC
|
||||
</select>
|
||||
|
||||
<select id="queryAllActiveList" resultType="com.cool.store.vo.config.ConfigItemCategoryBaseInfoVO">
|
||||
SELECT category_code, category_name
|
||||
FROM zxjp_cfg_item_category
|
||||
WHERE is_deleted = 0 AND status = 1 ORDER BY sort_no ASC, id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.config.ConfigItemMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.config.ConfigItemDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="item_code" property="itemCode" jdbcType="VARCHAR"/>
|
||||
<result column="item_name" property="itemName" jdbcType="VARCHAR"/>
|
||||
<result column="category_id" property="categoryId" jdbcType="BIGINT"/>
|
||||
<result column="sort_no" property="sortNo" jdbcType="INTEGER"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="created_user_id" property="createdUserId" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="updated_user_id" property="updatedUserId" jdbcType="VARCHAR"/>
|
||||
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ItemVOResultMap" type="com.cool.store.vo.config.ConfigItemVO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="item_code" property="itemCode" jdbcType="VARCHAR"/>
|
||||
<result column="item_name" property="itemName" jdbcType="VARCHAR"/>
|
||||
<result column="category_id" property="categoryId" jdbcType="BIGINT"/>
|
||||
<result column="category_code" property="categoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
|
||||
<result column="sort_no" property="sortNo" jdbcType="INTEGER"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="created_user_id" property="createdUserId" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="updated_user_id" property="updatedUserId" jdbcType="VARCHAR"/>
|
||||
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryByCondition" resultMap="ItemVOResultMap">
|
||||
SELECT i.id,
|
||||
i.item_code,
|
||||
i.item_name,
|
||||
i.category_id,
|
||||
c.category_code,
|
||||
c.category_name,
|
||||
i.sort_no,
|
||||
i.status,
|
||||
i.remark,
|
||||
i.created_user_id,
|
||||
i.created_time,
|
||||
i.updated_user_id,
|
||||
i.updated_time
|
||||
FROM zxjp_cfg_item i
|
||||
LEFT JOIN zxjp_cfg_item_category c ON i.category_id = c.id AND c.is_deleted = 0
|
||||
WHERE i.is_deleted = 0
|
||||
<if test="itemName != null and itemName != ''">
|
||||
AND i.item_name LIKE CONCAT('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != ''">
|
||||
AND i.item_code = #{itemCode}
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
AND i.category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND i.status = #{status}
|
||||
</if>
|
||||
ORDER BY i.sort_no ASC, i.id DESC
|
||||
</select>
|
||||
|
||||
<select id="queryAllActiveList" resultType="com.cool.store.vo.config.ConfigItemBaseInfoVO">
|
||||
SELECT item_code, item_name
|
||||
FROM zxjp_cfg_item
|
||||
WHERE is_deleted = 0 AND status = 1 ORDER BY sort_no ASC, id DESC
|
||||
</select>
|
||||
|
||||
<select id="countByCategoryIds" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1)
|
||||
FROM zxjp_cfg_item
|
||||
WHERE is_deleted = 0
|
||||
AND category_id IN
|
||||
<foreach collection="categoryIds" item="categoryId" open="(" separator="," close=")">
|
||||
#{categoryId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.config.ConfigOptionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.config.ConfigOptionDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="category_code" property="categoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="item_code" property="itemCode" jdbcType="VARCHAR"/>
|
||||
<result column="option_code" property="optionCode" jdbcType="VARCHAR"/>
|
||||
<result column="option_name" property="optionName" jdbcType="VARCHAR"/>
|
||||
<result column="option_description" property="optionDescription" jdbcType="VARCHAR"/>
|
||||
<result column="option_unit" property="optionUnit" jdbcType="VARCHAR"/>
|
||||
<result column="option_price" property="optionPrice" jdbcType="DECIMAL"/>
|
||||
<result column="original_option_price" property="originalOptionPrice" jdbcType="DECIMAL"/>
|
||||
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="is_active" property="active" jdbcType="BOOLEAN"/>
|
||||
<result column="sort_order" property="sortOrder" jdbcType="INTEGER"/>
|
||||
<result column="option_remark" property="optionRemark" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, category_code, item_code, option_code, option_name, option_description,
|
||||
option_price, original_option_price, image_url, video_url,
|
||||
is_active, sort_order, option_remark,
|
||||
create_time, update_time, option_unit
|
||||
</sql>
|
||||
|
||||
<select id="listActiveByIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_config_option
|
||||
WHERE is_active = 1
|
||||
AND id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
ORDER BY sort_order ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.FeeStandardConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.FeeStandardConfigDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="join_brand" jdbcType="TINYINT" property="joinBrand" />
|
||||
<result column="expense_type" jdbcType="VARCHAR" property="expenseType" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.PayeeBankConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.PayeeBankConfigDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="join_brand" jdbcType="BIT" property="joinBrand" />
|
||||
<result column="invest_division_id" jdbcType="BIGINT" property="investDivisionId" />
|
||||
<result column="pay_type" jdbcType="BIT" property="payType" />
|
||||
<result column="payee_name" jdbcType="VARCHAR" property="payeeName" />
|
||||
<result column="payee_code" jdbcType="VARCHAR" property="payeeCode" />
|
||||
<result column="payee_bank" jdbcType="VARCHAR" property="payeeBank" />
|
||||
<result column="payee_bank_branch" jdbcType="VARCHAR" property="payeeBankBranch" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.ShopAllocationInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.ShopAllocationInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="expense_type" jdbcType="VARCHAR" property="expenseType" />
|
||||
<result column="payee_name" jdbcType="VARCHAR" property="payeeName" />
|
||||
<result column="payee_code" jdbcType="VARCHAR" property="payeeCode" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="fail_reason" jdbcType="VARCHAR" property="failReason" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 批量新增 -->
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_fees_shop_allocation_info (shop_id, expense_type, payee_name, payee_code, amount, status, fail_reason, create_user_id, update_user_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.shopId}, #{item.expenseType}, #{item.payeeName}, #{item.payeeCode}, #{item.amount}, #{item.status}, #{item.failReason}, #{item.createUserId}, #{item.updateUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
UPDATE zxjp_fees_shop_allocation_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<trim prefix="shop_id = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.shopId}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="expense_type = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.expenseType}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="payee_name = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.payeeName}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="payee_code = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.payeeCode}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="amount = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.amount}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="status = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.status}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="fail_reason = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.failReason}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_user_id = CASE" suffix="END,">
|
||||
<foreach collection="list" item="item">
|
||||
WHEN id = #{item.id} THEN #{item.updateUserId}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<insert id="insertOrUpdateBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_fees_shop_allocation_info
|
||||
(id, shop_id, expense_type, payee_name, payee_code, amount, status, fail_reason, create_user_id, update_user_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id}, #{item.shopId}, #{item.expenseType}, #{item.payeeName}, #{item.payeeCode}, #{item.amount}, #{item.status}, #{item.failReason}, #{item.createUserId}, #{item.updateUserId})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
expense_type = VALUES(expense_type),
|
||||
payee_name = VALUES(payee_name),
|
||||
payee_code = VALUES(payee_code),
|
||||
amount = VALUES(amount),
|
||||
status = VALUES(status),
|
||||
fail_reason = VALUES(fail_reason),
|
||||
update_user_id = VALUES(update_user_id)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.WalletAllocationCompanyMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.WalletAllocationCompanyDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="config_id" jdbcType="BIGINT" property="configId"/>
|
||||
<result column="payee_name" jdbcType="VARCHAR" property="payeeName"/>
|
||||
<result column="payee_code" jdbcType="VARCHAR" property="payeeCode"/>
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_fees_wallet_allocation_company (config_id, payee_name, payee_code, create_user_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.configId}, #{item.payeeName}, #{item.payeeCode}, #{item.createUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.WalletAllocationConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.WalletAllocationConfigDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="join_brand" jdbcType="TINYINT" property="joinBrand" />
|
||||
<result column="invest_division_id" jdbcType="BIGINT" property="investDivisionId" />
|
||||
<result column="expense_type" jdbcType="VARCHAR" property="expenseType" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.fees.WalletPayInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.fees.WalletPayInfoDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="pay_no" jdbcType="VARCHAR" property="payNo" />
|
||||
<result column="pay_user_name" jdbcType="VARCHAR" property="payUserName" />
|
||||
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
|
||||
<result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
|
||||
<result column="pay_status" jdbcType="BIT" property="payStatus" />
|
||||
<result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
|
||||
<result column="claim_status" jdbcType="BIT" property="claimStatus" />
|
||||
<result column="expense_types" jdbcType="VARCHAR" property="expenseTypes" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_fees_wallet_pay_info (shop_id, module, pay_no, pay_user_name, pay_amount, trade_id, pay_status, pay_time, claim_status, expense_types, remark, create_user_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.shopId}, #{item.module}, #{item.payNo}, #{item.payUserName}, #{item.payAmount}, #{item.tradeId}, #{item.payStatus}, #{item.payTime}, #{item.claimStatus}, #{item.expenseTypes}, #{item.remark}, #{item.createUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPayNo" parameterType="com.cool.store.entity.fees.WalletPayInfoDO">
|
||||
UPDATE zxjp_fees_wallet_pay_info
|
||||
<set>
|
||||
<if test="shopId != null">shop_id = #{shopId},</if>
|
||||
<if test="module != null">module = #{module},</if>
|
||||
<if test="payUserName != null">pay_user_name = #{payUserName},</if>
|
||||
<if test="payAmount != null">pay_amount = #{payAmount},</if>
|
||||
<if test="tradeId != null">trade_id = #{tradeId},</if>
|
||||
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||
<if test="payTime != null">pay_time = #{payTime},</if>
|
||||
<if test="claimStatus != null">claim_status = #{claimStatus},</if>
|
||||
<if test="expenseTypes != null">expense_types = #{expenseTypes},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createUserId != null">create_user_id = #{createUserId},</if>
|
||||
create_time = create_time
|
||||
</set>
|
||||
WHERE pay_no = #{payNo}
|
||||
</update>
|
||||
|
||||
<update id="updateBatchByPayNo">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE zxjp_fees_wallet_pay_info
|
||||
<set>
|
||||
<if test="item.shopId != null">shop_id = #{item.shopId},</if>
|
||||
<if test="item.module != null">module = #{item.module},</if>
|
||||
<if test="item.payUserName != null">pay_user_name = #{item.payUserName},</if>
|
||||
<if test="item.payAmount != null">pay_amount = #{item.payAmount},</if>
|
||||
<if test="item.tradeId != null">trade_id = #{item.tradeId},</if>
|
||||
<if test="item.payStatus != null">pay_status = #{item.payStatus},</if>
|
||||
<if test="item.payTime != null">pay_time = #{item.payTime},</if>
|
||||
<if test="item.claimStatus != null">claim_status = #{item.claimStatus},</if>
|
||||
<if test="item.expenseTypes != null">expense_types = #{item.expenseTypes},</if>
|
||||
<if test="item.remark != null">remark = #{item.remark},</if>
|
||||
<if test="item.createUserId != null">create_user_id = #{item.createUserId},</if>
|
||||
create_time = create_time
|
||||
</set>
|
||||
WHERE pay_no = #{item.payNo}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.modify.ModifyRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.modify.ModifyRecordDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="module" jdbcType="VARCHAR" property="module" />
|
||||
<result column="business_id" jdbcType="BIGINT" property="businessId" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.order.PreAllocationRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.order.PreAllocationRecordDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="order_id" property="orderId" jdbcType="BIGINT"/>
|
||||
<result column="shop_id" property="shopId" jdbcType="BIGINT"/>
|
||||
<result column="pay_no" property="payNo" jdbcType="VARCHAR"/>
|
||||
<result column="expense_type" property="expenseType" jdbcType="VARCHAR"/>
|
||||
<result column="payee_name" property="payeeName" jdbcType="VARCHAR"/>
|
||||
<result column="payee_code" property="payeeCode" jdbcType="VARCHAR"/>
|
||||
<result column="pay_amount" property="payAmount" jdbcType="DECIMAL"/>
|
||||
<result column="allocation_status" property="allocationStatus" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, order_id, shop_id, pay_no, expense_type, payee_name, payee_code,
|
||||
pay_amount, allocation_status, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="getById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryPageByOrderId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE order_id = #{orderId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="queryPageByShopId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE shop_id = #{shopId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="queryPageByPayNo" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_pre_allocation_record
|
||||
WHERE pay_no = #{payNo}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE zxjp_pre_allocation_record
|
||||
SET allocation_status = #{status},
|
||||
update_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteByShopId">
|
||||
DELETE FROM zxjp_pre_allocation_record WHERE shop_id = #{shopId}
|
||||
</delete>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO zxjp_pre_allocation_record
|
||||
(order_id,shop_id,pay_no,expense_type,payee_name,payee_code,pay_amount,allocation_status,create_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="i" separator=",">
|
||||
(#{i.orderId},#{i.shopId},#{i.payNo},#{i.expenseType},#{i.payeeName},#{i.payeeCode},
|
||||
#{i.payAmount},#{i.allocationStatus},NOW())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBatch">
|
||||
<foreach collection="list" item="i" separator=";">
|
||||
UPDATE zxjp_pre_allocation_record
|
||||
SET pay_no = #{i.payNo},
|
||||
allocation_status = #{i.allocationStatus},
|
||||
update_time = NOW()
|
||||
WHERE id = #{i.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateByOrderId">
|
||||
<foreach collection="list" item="i" separator=";">
|
||||
UPDATE zxjp_pre_allocation_record
|
||||
SET pay_no = #{i.payNo},
|
||||
allocation_status = #{i.allocationStatus},
|
||||
update_time = NOW()
|
||||
where order_id = #{orderId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.order.StoreOrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.order.StoreOrderDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
|
||||
<result column="shop_id" property="shopId" jdbcType="BIGINT"/>
|
||||
<result column="line_id" property="lineId" jdbcType="BIGINT"/>
|
||||
<result column="partner_name" property="partnerName" jdbcType="VARCHAR"/>
|
||||
<result column="partner_mobile" property="partnerMobile" jdbcType="VARCHAR"/>
|
||||
<result column="investment_manager" property="investmentManager" jdbcType="VARCHAR"/>
|
||||
<result column="store_type_id" property="storeTypeId" jdbcType="BIGINT"/>
|
||||
<result column="store_type_code" property="storeTypeCode" jdbcType="VARCHAR"/>
|
||||
<result column="store_type_name" property="storeTypeName" jdbcType="VARCHAR"/>
|
||||
<result column="store_type" property="storeType" jdbcType="INTEGER"/>
|
||||
<result column="brand" property="brand" jdbcType="VARCHAR"/>
|
||||
<result column="franchise_fee" property="franchiseFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_franchise_fee" property="originalFranchiseFee" jdbcType="DECIMAL"/>
|
||||
<result column="brand_usage_fee" property="brandUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_brand_usage_fee" property="originalBrandUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="management_fee" property="managementFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_management_fee" property="originalManagementFee" jdbcType="DECIMAL"/>
|
||||
<result column="system_usage_fee" property="systemUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_system_usage_fee" property="originalSystemUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="first_order_fee" property="firstOrderFee" jdbcType="DECIMAL"/>
|
||||
<result column="contract_deposit" property="contractDeposit" jdbcType="DECIMAL"/>
|
||||
<result column="original_contract_deposit" property="originalContractDeposit" jdbcType="DECIMAL"/>
|
||||
<result column="design_fee" property="designFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_design_fee" property="originalDesignFee" jdbcType="DECIMAL"/>
|
||||
<result column="store_fixed_amount" property="storeFixedAmount" jdbcType="DECIMAL"/>
|
||||
<result column="option_amount" property="optionAmount" jdbcType="DECIMAL"/>
|
||||
<result column="total_amount" property="totalAmount" jdbcType="DECIMAL"/>
|
||||
<result column="paid_amount" property="paidAmount" jdbcType="DECIMAL"/>
|
||||
<result column="unpaid_amount" property="unpaidAmount" jdbcType="DECIMAL"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, order_no, shop_id, line_id, partner_name, partner_mobile, investment_manager,
|
||||
store_type_id, store_type_code, store_type_name, store_type, brand,
|
||||
franchise_fee, original_franchise_fee,
|
||||
brand_usage_fee, original_brand_usage_fee,
|
||||
management_fee, original_management_fee,
|
||||
system_usage_fee, original_system_usage_fee,
|
||||
contract_deposit, original_contract_deposit,
|
||||
design_fee, original_design_fee,
|
||||
first_order_fee,
|
||||
store_fixed_amount, option_amount, total_amount, paid_amount, unpaid_amount,
|
||||
status, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="getById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_order
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="queryPage" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_order
|
||||
<where>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
<if test="shopId != null">AND</if>
|
||||
status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="queryPageByLineId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_order
|
||||
<where>
|
||||
<if test="lineId != null">
|
||||
line_id = #{lineId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
<if test="lineId != null">AND</if>
|
||||
status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="countByShopIdAndStatusIn" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM zxjp_store_order
|
||||
WHERE shop_id = #{shopId}
|
||||
AND status IN
|
||||
<foreach collection="statuses" item="st" open="(" separator="," close=")">
|
||||
#{st}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="countByShopIdAndStatus" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM zxjp_store_order
|
||||
WHERE shop_id = #{shopId}
|
||||
AND status = #{status}
|
||||
</select>
|
||||
|
||||
<select id="getLatestDraftByShopId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_order
|
||||
WHERE shop_id = #{shopId}
|
||||
AND status = #{status}
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getLatestOrderByShopId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_order
|
||||
WHERE shop_id = #{shopId}
|
||||
AND status != 25
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="queryPCPage" resultType="com.cool.store.vo.order.PCStoreOrderListVO">
|
||||
SELECT
|
||||
a.id AS orderId,
|
||||
a.order_no AS orderNo,
|
||||
a.store_type AS storeType,
|
||||
a.brand AS brand,
|
||||
a.store_type_name AS name,
|
||||
a.total_amount AS totalAmount,
|
||||
a.paid_amount AS paidAmount,
|
||||
a.unpaid_amount AS unpaidAmount,
|
||||
a.store_fixed_amount as storeFixedAmount,
|
||||
a.status AS status,
|
||||
a.create_time AS orderTime,
|
||||
c.username AS partnerName,
|
||||
c.mobile AS partnerMobile,
|
||||
b.shop_code as shopCode,
|
||||
b.shop_name as shopName
|
||||
FROM zxjp_store_order a
|
||||
LEFT JOIN xfsg_shop_info b ON a.shop_id = b.id
|
||||
LEFT JOIN xfsg_line_info c ON a.line_id = c.id
|
||||
<where>
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
AND a.order_no LIKE CONCAT('%', #{orderNo}, '%')
|
||||
</if>
|
||||
<if test="partnerName != null and partnerName != ''">
|
||||
AND c.username LIKE CONCAT('%', #{partnerName}, '%')
|
||||
</if>
|
||||
<if test="partnerMobile != null and partnerMobile != ''">
|
||||
AND c.mobile LIKE CONCAT('%', #{partnerMobile}, '%')
|
||||
</if>
|
||||
<if test="brand != null and brand != ''">
|
||||
AND a.brand = #{brand}
|
||||
</if>
|
||||
<if test="storeTypeId != null">
|
||||
AND a.store_type_id = #{storeTypeId}
|
||||
</if>
|
||||
<if test="orderTimeStart != null">
|
||||
AND a.create_time >= #{orderTimeStart}
|
||||
</if>
|
||||
<if test="orderTimeEnd != null">
|
||||
AND a.create_time <= #{orderTimeEnd}
|
||||
</if>
|
||||
<if test="payTimeStart != null">
|
||||
AND a.pay_time >= #{payTimeStart}
|
||||
</if>
|
||||
<if test="payTimeEnd != null">
|
||||
AND a.pay_time <= #{payTimeEnd}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM zxjp_store_order a
|
||||
LEFT JOIN xfsg_shop_info b ON a.shop_id = b.id
|
||||
LEFT JOIN xfsg_line_info c ON a.line_id = c.id
|
||||
<where>
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
AND a.order_no LIKE CONCAT('%', #{orderNo}, '%')
|
||||
</if>
|
||||
<if test="partnerName != null and partnerName != ''">
|
||||
AND c.username LIKE CONCAT('%', #{partnerName}, '%')
|
||||
</if>
|
||||
<if test="partnerMobile != null and partnerMobile != ''">
|
||||
AND c.mobile LIKE CONCAT('%', #{partnerMobile}, '%')
|
||||
</if>
|
||||
<if test="brand != null and brand != ''">
|
||||
AND a.brand = #{brand}
|
||||
</if>
|
||||
<if test="storeTypeId != null">
|
||||
AND a.store_type_id = #{storeTypeId}
|
||||
</if>
|
||||
<if test="orderTimeStart != null">
|
||||
AND a.create_time >= #{orderTimeStart}
|
||||
</if>
|
||||
<if test="orderTimeEnd != null">
|
||||
AND a.create_time <= #{orderTimeEnd}
|
||||
</if>
|
||||
<if test="payTimeStart != null">
|
||||
AND a.pay_time >= #{payTimeStart}
|
||||
</if>
|
||||
<if test="payTimeEnd != null">
|
||||
AND a.pay_time <= #{payTimeEnd}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.order.StoreOrderOptionSnapshotMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.order.StoreOrderOptionSnapshotDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="order_id" property="orderId" jdbcType="BIGINT"/>
|
||||
<result column="shop_id" property="shopId" jdbcType="BIGINT"/>
|
||||
<result column="store_type_id" property="storeTypeId" jdbcType="BIGINT"/>
|
||||
<result column="option_id" property="optionId" jdbcType="BIGINT"/>
|
||||
<result column="category_code" property="categoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="item_code" property="itemCode" jdbcType="VARCHAR"/>
|
||||
<result column="option_code" property="optionCode" jdbcType="VARCHAR"/>
|
||||
<result column="option_unit" property="optionUnit" jdbcType="VARCHAR"/>
|
||||
<result column="option_name" property="optionName" jdbcType="VARCHAR"/>
|
||||
<result column="option_price" property="optionPrice" jdbcType="DECIMAL"/>
|
||||
<result column="original_option_price" property="originalOptionPrice" jdbcType="DECIMAL"/>
|
||||
<result column="option_remark" property="optionRemark" jdbcType="VARCHAR"/>
|
||||
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="quantity" property="quantity" jdbcType="INTEGER"/>
|
||||
<result column="amount" property="amount" jdbcType="DECIMAL"/>
|
||||
<result column="original_amount" property="originalAmount" jdbcType="DECIMAL"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, order_id, shop_id, store_type_id, option_id, category_code, item_code,
|
||||
option_code, option_name, option_price, original_option_price, option_remark, image_url, video_url,
|
||||
quantity, amount, original_amount, create_time, option_unit
|
||||
</sql>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO zxjp_store_order_option_snapshot
|
||||
(order_id, shop_id, store_type_id, option_id, category_code, item_code,
|
||||
option_code, option_name, option_price, original_option_price, option_remark, image_url, video_url,
|
||||
quantity, amount, original_amount, create_time, option_unit)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.orderId}, #{item.shopId}, #{item.storeTypeId}, #{item.optionId},
|
||||
#{item.categoryCode}, #{item.itemCode}, #{item.optionCode}, #{item.optionName},
|
||||
#{item.optionPrice}, #{item.originalOptionPrice}, #{item.optionRemark}, #{item.imageUrl}, #{item.videoUrl},
|
||||
#{item.quantity}, #{item.amount}, #{item.originalAmount}, NOW(), #{item.optionUnit})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="listByOrderId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
a.id,
|
||||
a.order_id,
|
||||
a.shop_id,
|
||||
a.store_type_id,
|
||||
a.option_id,
|
||||
a.category_code,
|
||||
a.item_code,
|
||||
a.option_code,
|
||||
a.option_name,
|
||||
a.option_price,
|
||||
a.original_option_price,
|
||||
a.option_remark,
|
||||
a.image_url,
|
||||
a.video_url,
|
||||
a.quantity,
|
||||
a.amount,
|
||||
a.original_amount,
|
||||
a.create_time,
|
||||
a.option_unit
|
||||
FROM zxjp_store_order_option_snapshot a left join
|
||||
sys_dict_column_5558ce7a3aa84e3590392fcaa8697ffb b on a.category_code = b.column_code
|
||||
WHERE order_id = #{orderId}
|
||||
ORDER BY b.id asc,a.id ASC
|
||||
</select>
|
||||
|
||||
<delete id="deleteByOrderId">
|
||||
DELETE FROM zxjp_store_order_option_snapshot
|
||||
WHERE order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<update id="batchUpdateQuantityAndAmount" parameterType="java.util.List">
|
||||
UPDATE zxjp_store_order_option_snapshot
|
||||
SET
|
||||
quantity = CASE id
|
||||
<foreach collection="list" item="item" separator=" ">
|
||||
WHEN #{item.id} THEN #{item.quantity}
|
||||
</foreach>
|
||||
ELSE quantity
|
||||
END,
|
||||
amount = CASE id
|
||||
<foreach collection="list" item="item" separator=" ">
|
||||
WHEN #{item.id} THEN #{item.amount}
|
||||
</foreach>
|
||||
ELSE amount
|
||||
END,
|
||||
original_amount = CASE id
|
||||
<foreach collection="list" item="item" separator=" ">
|
||||
WHEN #{item.id} THEN #{item.originalAmount}
|
||||
</foreach>
|
||||
ELSE original_amount
|
||||
END
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.order.StoreWishlistMapper">
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO zxjp_store_wishlist
|
||||
(line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.lineId}, #{item.storeTypeId}, #{item.optionId}, #{item.quantity}, #{item.totalAmount}, #{item.versionNo}, 0, NOW(), NOW())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="softDeleteByLineIdAndStoreTypeAndVersion">
|
||||
UPDATE zxjp_store_wishlist
|
||||
SET deleted = 1,
|
||||
update_time = NOW()
|
||||
WHERE line_id = #{lineId}
|
||||
AND store_type_id = #{storeTypeId}
|
||||
AND version_no = #{versionNo}
|
||||
AND deleted = 0
|
||||
</update>
|
||||
|
||||
<select id="getById" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
||||
SELECT id, line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time
|
||||
FROM zxjp_store_wishlist
|
||||
WHERE id = #{id}
|
||||
AND deleted = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="listByLineIdAndStoreTypeAndVersion" resultType="com.cool.store.entity.order.StoreWishlistDO">
|
||||
SELECT id, line_id, store_type_id, option_id, quantity, total_amount, version_no, deleted, create_time, update_time
|
||||
FROM zxjp_store_wishlist
|
||||
WHERE line_id = #{lineId}
|
||||
AND store_type_id = #{storeTypeId}
|
||||
AND version_no = #{versionNo}
|
||||
AND deleted = 0
|
||||
ORDER BY id ASC
|
||||
</select>
|
||||
|
||||
<select id="listByLineId" resultType="com.cool.store.vo.order.MiniStoreWishlistListVO">
|
||||
SELECT
|
||||
w.store_type_id AS storeTypeId,
|
||||
st.brand AS brand,
|
||||
st.store_type_name AS storeTypeName,
|
||||
st.store_type AS storeType,
|
||||
st.image_url AS imageUrl,
|
||||
MIN(w.create_time) AS createTime,
|
||||
MAX(w.total_amount) AS totalAmount,
|
||||
w.version_no AS versionNo
|
||||
FROM zxjp_store_wishlist w
|
||||
LEFT JOIN zxjp_store_type st ON st.id = w.store_type_id
|
||||
WHERE w.line_id = #{lineId}
|
||||
AND w.deleted = 0
|
||||
<if test="storeTypeId != null">
|
||||
AND w.store_type_id = #{storeTypeId}
|
||||
</if>
|
||||
GROUP BY w.version_no
|
||||
ORDER BY w.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.store.StoreTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.store.StoreTypeDO">
|
||||
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||
<result column="store_type_code" property="storeTypeCode" jdbcType="VARCHAR"/>
|
||||
<result column="store_type_name" property="storeTypeName" jdbcType="VARCHAR"/>
|
||||
<result column="brand" property="brand" jdbcType="VARCHAR"/>
|
||||
<result column="store_type" property="storeType" jdbcType="INTEGER"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
<result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="vr_video_url" property="vrVideoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="franchise_fee" property="franchiseFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_franchise_fee" property="originalFranchiseFee" jdbcType="DECIMAL"/>
|
||||
<result column="brand_usage_fee" property="brandUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_brand_usage_fee" property="originalBrandUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="management_fee" property="managementFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_management_fee" property="originalManagementFee" jdbcType="DECIMAL"/>
|
||||
<result column="system_usage_fee" property="systemUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_system_usage_fee" property="originalSystemUsageFee" jdbcType="DECIMAL"/>
|
||||
<result column="contract_deposit" property="contractDeposit" jdbcType="DECIMAL"/>
|
||||
<result column="original_contract_deposit" property="originalContractDeposit" jdbcType="DECIMAL"/>
|
||||
<result column="design_fee" property="designFee" jdbcType="DECIMAL"/>
|
||||
<result column="original_design_fee" property="originalDesignFee" jdbcType="DECIMAL"/>
|
||||
<result column="first_order_fee" property="firstOrderFee" jdbcType="DECIMAL"/>
|
||||
<result column="sort_order" property="sortOrder" jdbcType="INTEGER"/>
|
||||
<result column="is_active" property="active" jdbcType="BOOLEAN"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, store_type_code, store_type_name, brand, store_type, description,
|
||||
image_url, video_url, vr_video_url,
|
||||
franchise_fee, original_franchise_fee,
|
||||
brand_usage_fee, original_brand_usage_fee,
|
||||
management_fee, original_management_fee,
|
||||
system_usage_fee, original_system_usage_fee,
|
||||
contract_deposit, original_contract_deposit,
|
||||
design_fee, original_design_fee,
|
||||
first_order_fee, sort_order,
|
||||
is_active, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="queryByCondition" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_type
|
||||
WHERE deleted = 0
|
||||
<if test="active != null">
|
||||
AND is_active = #{active}
|
||||
</if>
|
||||
<if test="brand != null and brand != ''">
|
||||
AND brand = #{brand}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (store_type_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR store_type_code LIKE CONCAT('%', #{keyword}, '%'))
|
||||
</if>
|
||||
ORDER BY sort_order ASC, create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="listByStoreType" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zxjp_store_type
|
||||
WHERE deleted = 0
|
||||
AND is_active = 1
|
||||
AND store_type = #{storeType}
|
||||
ORDER BY sort_order ASC, create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.store.StoreTypeOptionMapper">
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO zxjp_store_type_option
|
||||
(
|
||||
store_type_id,
|
||||
option_id,
|
||||
category_code,
|
||||
item_code,
|
||||
is_default,
|
||||
default_quantity,
|
||||
allow_quantity_edit,
|
||||
sort_order,
|
||||
option_price,
|
||||
top_preview_image,
|
||||
create_time,
|
||||
update_time
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.storeTypeId},
|
||||
#{item.optionId},
|
||||
#{item.categoryCode},
|
||||
#{item.itemCode},
|
||||
#{item.isDefault},
|
||||
#{item.defaultQuantity},
|
||||
#{item.allowQuantityEdit},
|
||||
#{item.sortOrder},
|
||||
#{item.optionPrice},
|
||||
#{item.topPreviewImage},
|
||||
NOW(),
|
||||
NOW()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.visit.StoreVisitReservationMapper">
|
||||
|
||||
<select id="adminPage" resultType="com.cool.store.vo.visit.StoreVisitReservationVO">
|
||||
SELECT
|
||||
id,
|
||||
intent_city_id AS intentCityId,
|
||||
contact_name AS contactName,
|
||||
mobile,
|
||||
visit_time AS visitTime,
|
||||
status,
|
||||
remark,
|
||||
cancel_reason AS cancelReason,
|
||||
current_follow_user AS currentFollowUser,
|
||||
service_user_id AS serviceUserId,
|
||||
create_time AS createTime
|
||||
FROM zxjp_store_visit_reservation
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="request.status != null">
|
||||
AND status = #{request.status}
|
||||
</if>
|
||||
<if test="request.contactName != null and request.contactName != ''">
|
||||
AND contact_name LIKE CONCAT('%', #{request.contactName}, '%')
|
||||
</if>
|
||||
<if test="request.mobile != null and request.mobile != ''">
|
||||
AND mobile LIKE CONCAT('%', #{request.mobile}, '%')
|
||||
</if>
|
||||
<if test="request.serviceUserId != null and request.serviceUserId != ''">
|
||||
AND service_user_id = #{request.serviceUserId}
|
||||
</if>
|
||||
<if test="request.visitStartTime != null">
|
||||
AND visit_time <![CDATA[ >= ]]> #{request.visitStartTime}
|
||||
</if>
|
||||
<if test="request.visitEndTime != null">
|
||||
AND visit_time <![CDATA[ <= ]]> #{request.visitEndTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.wallet.WalletTradeMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.wallet.WalletTradeDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="module" jdbcType="VARCHAR" property="module" />
|
||||
<result column="pay_no" jdbcType="VARCHAR" property="payNo" />
|
||||
<result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
|
||||
<result column="type" jdbcType="BIT" property="type" />
|
||||
<result column="pay_user_name" jdbcType="VARCHAR" property="payUserName" />
|
||||
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
|
||||
<result column="pay_status" jdbcType="BIT" property="payStatus" />
|
||||
<result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 批量新增 -->
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_wallet_trade (module, pay_no, trade_id, type, pay_user_name, pay_amount, pay_status, pay_time, remark, create_user_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.module}, #{item.payNo}, #{item.tradeId}, #{item.type}, #{item.payUserName}, #{item.payAmount}, #{item.payStatus}, #{item.payTime}, #{item.remark}, #{item.createUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPayNo" parameterType="com.cool.store.entity.wallet.WalletTradeDO">
|
||||
UPDATE zxjp_wallet_trade
|
||||
<set>
|
||||
<if test="module != null">module = #{module},</if>
|
||||
<if test="tradeId != null">trade_id = #{tradeId},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="payUserName != null">pay_user_name = #{payUserName},</if>
|
||||
<if test="payAmount != null">pay_amount = #{payAmount},</if>
|
||||
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||
<if test="payTime != null">pay_time = #{payTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createUserId != null">create_user_id = #{createUserId},</if>
|
||||
create_time = create_time
|
||||
</set>
|
||||
WHERE pay_no = #{payNo}
|
||||
</update>
|
||||
|
||||
<update id="updateBatchByPayNo">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE zxjp_wallet_trade
|
||||
<set>
|
||||
<if test="item.module != null">module = #{item.module},</if>
|
||||
<if test="item.tradeId != null">trade_id = #{item.tradeId},</if>
|
||||
<if test="item.type != null">type = #{item.type},</if>
|
||||
<if test="item.payUserName != null">pay_user_name = #{item.payUserName},</if>
|
||||
<if test="item.payAmount != null">pay_amount = #{item.payAmount},</if>
|
||||
<if test="item.payStatus != null">pay_status = #{item.payStatus},</if>
|
||||
<if test="item.payTime != null">pay_time = #{item.payTime},</if>
|
||||
<if test="item.remark != null">remark = #{item.remark},</if>
|
||||
<if test="item.createUserId != null">create_user_id = #{item.createUserId},</if>
|
||||
create_time = create_time
|
||||
</set>
|
||||
WHERE pay_no = #{item.payNo}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user