业务备注

This commit is contained in:
shuo.wang
2025-05-27 15:22:52 +08:00
parent c8504734f3
commit 9025ee6446
8 changed files with 309 additions and 28 deletions

View File

@@ -0,0 +1,75 @@
package com.cool.store.dao;
import com.cool.store.entity.ShopStageRemarkInfoDO;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.ShopStageRemarkInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Objects;
/**
* @Author: WangShuo
* @Date: 2025/05/27/14:22
* @Version 1.0
* @注释:
*/
@Repository
public class ShopStageRemarkInfoDAO {
@Autowired
private ShopStageRemarkInfoMapper shopStageRemarkInfoMapper;
public Integer insertOrUpdate(ShopStageRemarkInfoDO shopStageRemarkInfoDO) {
if (shopStageRemarkInfoDO.getId() != null) {
return shopStageRemarkInfoMapper.updateByPrimaryKeySelective(shopStageRemarkInfoDO);
} else {
return shopStageRemarkInfoMapper.insertSelective(shopStageRemarkInfoDO);
}
}
public ShopStageRemarkInfoDO getByShopIdAndStage(Long shopId, Integer shopSubStageStatus) {
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageStatus)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andEqualTo("shopId", shopId).andEqualTo("shopSubStageStatus", shopSubStageStatus);
ShopStageRemarkInfoDO shopStageRemarkInfoDO = shopStageRemarkInfoMapper.selectOneByExample(example);
if (Objects.isNull(shopStageRemarkInfoDO)){
return new ShopStageRemarkInfoDO();
}
return shopStageRemarkInfoDO;
}
public ShopStageRemarkInfoDO getByLineIdAndStage(Long lineId, Integer workflowSubStageStatus) {
if (Objects.isNull(lineId) || Objects.isNull(workflowSubStageStatus)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andEqualTo("lineId", lineId).andEqualTo("workflowSubStageStatus", workflowSubStageStatus);
ShopStageRemarkInfoDO shopStageRemarkInfoDO = shopStageRemarkInfoMapper.selectOneByExample(example);
if (Objects.isNull(shopStageRemarkInfoDO)){
return new ShopStageRemarkInfoDO();
}
return shopStageRemarkInfoDO;
}
public List<ShopStageRemarkInfoDO> getByShopIdsAndStage(List<Long> shopIds, List<Integer> shopSubStageStatusList) {
if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(shopSubStageStatusList)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andIn("shopId", shopIds).andIn("shopSubStageStatus", shopSubStageStatusList);
return shopStageRemarkInfoMapper.selectByExample(example);
}
public List<ShopStageRemarkInfoDO> getByLineIdsAndStage(List<Long> lineIds, List<Integer> workflowSubStageStatusList) {
if (CollectionUtils.isEmpty(lineIds) || CollectionUtils.isEmpty(workflowSubStageStatusList)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andIn("lineId", lineIds).andIn("workflowSubStageStatus", workflowSubStageStatusList);
return shopStageRemarkInfoMapper.selectByExample(example);
}
}

View File

@@ -0,0 +1,14 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopStageRemarkInfoDO;
import tk.mybatis.mapper.common.Mapper;
/**
* @Author: WangShuo
* @Date: 2025/05/27/14:19
* @Version 1.0
* @注释:
*/
public interface ShopStageRemarkInfoMapper extends Mapper<ShopStageRemarkInfoDO> {
}

View File

@@ -0,0 +1,21 @@
<?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">
<!--mybatis-3-mapper.dtd:约束文件的名称限制和检查在当前文件中出现的标签和属性符合mybatis的要求-->
<!--namespace命名空间要有唯一的值要求使用dao接口的权限定名称一个dao接口对应一个mappernamespace指明对应哪个dao接口-->
<mapper namespace="com.cool.store.mapper.ShopStageRemarkInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageRemarkInfoDO">
<result column="id" property="id" jdbcType="BIGINT" />
<result column="shop_id" property="shopId" jdbcType="BIGINT" />
<result column="shop_sub_stage" property="shopSubStage" jdbcType="INTEGER" />
<result column="shop_sub_stage_status" property="shopSubStageStatus" jdbcType="INTEGER" />
<result column="line_id" property="lineId" jdbcType="BIGINT" />
<result column="workflow_sub_stage" property="workflowSubStage" jdbcType="INTEGER" />
<result column="workflow_sub_stage_status" property="workflowSubStageStatus" jdbcType="INTEGER" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="create_user_id" property="createUserId" jdbcType="VARCHAR" />
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
</resultMap>
</mapper>