feat:事项
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.MessageTemplateDO;
|
||||
import com.cool.store.mapper.MessageTemplateMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/7/25 9:40
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Repository
|
||||
public class MessageTemplateDAO {
|
||||
|
||||
@Resource
|
||||
private MessageTemplateMapper messageTemplateMapper;
|
||||
|
||||
|
||||
public int insert(MessageTemplateDO messageTemplateDO) {
|
||||
return messageTemplateMapper.insertSelective(messageTemplateDO);
|
||||
}
|
||||
|
||||
public int update(MessageTemplateDO messageTemplateDO) {
|
||||
return messageTemplateMapper.updateByPrimaryKeySelective(messageTemplateDO);
|
||||
}
|
||||
|
||||
public MessageTemplateDO getById(Long id) {
|
||||
return messageTemplateMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<MessageTemplateDO> getByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return messageTemplateMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
public int updateDeleteStatusBatch(List<Long> ids,String userId) {
|
||||
return messageTemplateMapper.updateDeleteStatusBatch(ids,userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.StoreMessageDO;
|
||||
import com.cool.store.mapper.StoreMessageMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/7/25 15:04
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class StoreMessageDAO {
|
||||
|
||||
@Resource
|
||||
StoreMessageMapper storeMessageMapper;
|
||||
/**
|
||||
* 批量新增
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public int batchInsert(List<StoreMessageDO> list){
|
||||
return storeMessageMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/7/25 11:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface EnterpriseUserGroupMappingMapper {
|
||||
|
||||
List<String> getUserIdsByGroupIdList(@Param("groupIdList") List<String> groupIdList);
|
||||
|
||||
}
|
||||
@@ -99,4 +99,6 @@ public interface EnterpriseUserMapper {
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> searchUserByUserIdsAndKeyword( @Param("userIdList") List<String> userIdList, @Param("keyword") String keyword);
|
||||
|
||||
List<String> getUserIdsByRegionIdList( @Param("regionIdList") List<String> regionIdList);
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.MessageTemplateDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MessageTemplateMapper extends Mapper<MessageTemplateDO> {
|
||||
|
||||
List<MessageTemplateDO> selectByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
int updateDeleteStatusBatch(@Param("ids") List<Long> ids, @Param("userId") String userId);
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.ShopAccountDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface ShopAccountMapper extends Mapper<ShopAccountDO> {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.StoreGroupMappingDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/7/25 10:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface StoreGroupMappingMapper {
|
||||
|
||||
List<StoreGroupMappingDO> getStoreGroupMappingByGroupIDs( @Param("groupIds")List<String> groupIds);
|
||||
|
||||
}
|
||||
@@ -45,4 +45,6 @@ public interface StoreMapper {
|
||||
|
||||
List<StoreDO> getStoreNumByStoreCodes(@Param("storeCodeIds") List<String> storeCodeIds);
|
||||
|
||||
List<StoreAreaDTO> listStoreByRegionPathList(@Param("regionPathList") List<String> regionPathList);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.StoreMessageDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StoreMessageMapper extends Mapper<StoreMessageDO> {
|
||||
|
||||
int insertBatch(@Param("list") List<StoreMessageDO> list);
|
||||
|
||||
}
|
||||
@@ -203,4 +203,15 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getUserIdsByRegionIdList" resultType="string">
|
||||
select
|
||||
user_id
|
||||
from enterprise_user_${enterpriseId} where user_id != 'a100000001' and active=1
|
||||
<if test="regionIdList != null and regionIdList.size >0 ">
|
||||
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
|
||||
user_region_ids like concat('%/', #{regionId}, '/%')
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -30,4 +30,31 @@
|
||||
<result column="handle_person_info" jdbcType="LONGVARCHAR" property="handlePersonInfo" />
|
||||
<result column="store_info" jdbcType="LONGVARCHAR" property="storeInfo" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM zxjp_message_template
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id,jdbcType=BIGINT}
|
||||
</foreach>
|
||||
AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<update id="updateDeleteStatusBatch" >
|
||||
UPDATE zxjp_message_template
|
||||
SET
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
update_time = NOW(),
|
||||
update_user_id = #{userId,jdbcType=VARCHAR}
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id,jdbcType=BIGINT}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
</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.StoreGroupMappingMapper">
|
||||
|
||||
<select id="getStoreGroupMappingByGroupIDs"
|
||||
resultType="com.cool.store.entity.StoreGroupMappingDO">
|
||||
select
|
||||
group_id as groupId,
|
||||
store_id as storeId
|
||||
from store_group_mapping_${enterpriseId}
|
||||
<where>
|
||||
<foreach collection="groupIds" open=" group_id in (" close=")" separator="," item="groupId">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</where>
|
||||
group by group_id,store_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -126,6 +126,7 @@
|
||||
|
||||
<select id="getStoreAreaList" resultType="com.cool.store.dto.store.StoreAreaDTO">
|
||||
select
|
||||
a.store_num as storeCode,
|
||||
a.store_name as storeName,
|
||||
a.store_id as storeId,
|
||||
a.region_path as regionPath,
|
||||
@@ -155,4 +156,20 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listStoreByRegionPathList" resultType="com.cool.store.dto.store.StoreAreaDTO">
|
||||
select
|
||||
store_name as storeName,
|
||||
store_id as storeId,
|
||||
region_path as regionPath,
|
||||
region_id as regionId,
|
||||
region_id as areaId
|
||||
from store_${enterpriseId}
|
||||
where is_delete = 'effective'
|
||||
<if test="regionPathList != null and regionPathList.size >0 ">
|
||||
<foreach collection="regionPathList" item="regionPath" separator=" or " open="and (" close=" )">
|
||||
region_path like concat(#{regionPath}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -24,4 +24,33 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="operator_list" jdbcType="LONGVARCHAR" property="operatorList" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO store_message (
|
||||
store_id,
|
||||
store_code,
|
||||
store_name,
|
||||
message_template_id,
|
||||
read_status,
|
||||
read_time,
|
||||
process_status,
|
||||
process_time,
|
||||
operator_list
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.storeId,jdbcType=VARCHAR},
|
||||
#{item.storeCode,jdbcType=VARCHAR},
|
||||
#{item.storeName,jdbcType=VARCHAR},
|
||||
#{item.messageTemplateId,jdbcType=BIGINT},
|
||||
#{item.readStatus,jdbcType=BIT},
|
||||
#{item.readTime,jdbcType=TIMESTAMP},
|
||||
#{item.processStatus,jdbcType=TINYINT},
|
||||
#{item.processTime,jdbcType=TIMESTAMP},
|
||||
#{item.operatorList,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.EnterpriseUserGroupMappingMapper">
|
||||
|
||||
<select id="getUserIdsByGroupIdList" resultType="string">
|
||||
select
|
||||
user_id
|
||||
from enterprise_user_group_mapping_${enterpriseId}
|
||||
where group_id in (
|
||||
<foreach collection="groupIdList" item="groupId" separator=",">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user