B端 部分接口3

This commit is contained in:
苏竹红
2023-06-14 19:38:38 +08:00
parent df2f2e307d
commit c0cf731ac3
21 changed files with 762 additions and 50 deletions

View File

@@ -2,6 +2,7 @@ package com.cool.store.dao;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.mapper.EnterpriseUserMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
@@ -27,6 +28,13 @@ public class EnterpriseUserDAO {
return enterpriseUserMapper.getUserInfoById(userId);
}
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList){
if(CollectionUtils.isEmpty(userIdList)){
return Lists.newArrayList();
}
return enterpriseUserMapper.getUserInfoByUserIds(userIdList);
}
public void batchInsertOrUpdate(List<EnterpriseUserDO> insertOrUpdateList) {
if(CollectionUtils.isEmpty(insertOrUpdateList)){
return;

View File

@@ -0,0 +1,71 @@
package com.cool.store.dao;
import com.cool.store.dto.partner.ZoneCheckDTO;
import com.cool.store.entity.HyIntendDevelopementMappingDO;
import com.cool.store.mapper.HyIntendDevelopementMappingMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/6/14 14:42
* @Version 1.0
*/
@Repository
public class HyIntendDevMappingDAO {
@Resource
HyIntendDevelopementMappingMapper hyIntendDevelopementMappingMapper;
public int insertSelective(HyIntendDevelopementMappingDO record){
return hyIntendDevelopementMappingMapper.insertSelective(record);
}
public int updateByPrimaryKeySelective(HyIntendDevelopementMappingDO record){
return hyIntendDevelopementMappingMapper.updateByPrimaryKeySelective(record);
}
public int deleteByOpenAreaIds(List<Long> openAreaIds,String type){
if (CollectionUtils.isEmpty(openAreaIds)){
return 0;
}
return hyIntendDevelopementMappingMapper.deleteByOpenAreaIds(openAreaIds,type);
}
public int deleteByMappingIds(List<Long> mappingIds,String type){
if (CollectionUtils.isEmpty(mappingIds)){
return 0;
}
return hyIntendDevelopementMappingMapper.deleteByMappingIds(mappingIds,type);
}
public List<ZoneCheckDTO> selectByMappingIdList(List<Long> idList){
if (CollectionUtils.isEmpty(idList)){
return new ArrayList<>();
}
return hyIntendDevelopementMappingMapper.selectByMappingIdList(idList);
}
public int batchInsert(List<HyIntendDevelopementMappingDO> recordList){
if (CollectionUtils.isEmpty(recordList)){
return 0;
}
return hyIntendDevelopementMappingMapper.batchInsert(recordList);
}
}

View File

@@ -0,0 +1,50 @@
package com.cool.store.dao;
import com.cool.store.entity.HyIntendDevZoneInfoDO;
import com.cool.store.mapper.HyIntendDevZoneInfoMapper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
/**
* @Author suzhuhong
* @Date 2023/6/14 14:40
* @Version 1.0
*/
@Repository
public class HyIntendDevZoneInfoDAO {
@Resource
HyIntendDevZoneInfoMapper hyIntendDevZoneInfoMapper;
public int insertSelective( HyIntendDevZoneInfoDO record){
return hyIntendDevZoneInfoMapper.insertSelective(record);
}
public int updateByPrimaryKeySelective(HyIntendDevZoneInfoDO record){
return hyIntendDevZoneInfoMapper.updateByPrimaryKeySelective(record);
}
public HyIntendDevZoneInfoDO selectById(Long id){
if (id==null){
return null;
}
return hyIntendDevZoneInfoMapper.selectById(id);
}
public PageInfo<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type){
if (StringUtils.isEmpty(type)){
return new PageInfo<>();
}
return hyIntendDevZoneInfoMapper.getHyIntendDevZoneInfoList(type);
}
}

View File

@@ -13,7 +13,7 @@ public interface EnterpriseUserMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-06-06 02:29
*/
int batchInsertOrUpdate(@Param("recordList") List<EnterpriseUserDO> recordList);
@@ -32,6 +32,13 @@ public interface EnterpriseUserMapper {
*/
EnterpriseUserDO getUserInfoById(@Param("userId") String userId);
/**
* 批量获取用户信息
* @param userIdList
* @return
*/
List<EnterpriseUserDO> getUserInfoByUserIds(@Param("userIdList") List<String> userIdList);
/**
* 删除用户
* @param excludeUserIds

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyIntendDevZoneInfoDO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
/**
@@ -11,7 +12,7 @@ public interface HyIntendDevZoneInfoMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:50
*/
int insertSelective(@Param("record") HyIntendDevZoneInfoDO record);
@@ -22,4 +23,18 @@ public interface HyIntendDevZoneInfoMapper {
* dateTime:2023-05-29 03:50
*/
int updateByPrimaryKeySelective(@Param("record") HyIntendDevZoneInfoDO record);
/**
* 根据ID查询
* @param id
* @return
*/
HyIntendDevZoneInfoDO selectById(@Param("id") Long id);
/**
* 查询战区列表
* @param type
* @return
*/
PageInfo<HyIntendDevZoneInfoDO> getHyIntendDevZoneInfoList(String type);
}

View File

@@ -1,8 +1,11 @@
package com.cool.store.mapper;
import com.cool.store.dto.partner.ZoneCheckDTO;
import com.cool.store.entity.HyIntendDevelopementMappingDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-29 03:50
@@ -11,7 +14,7 @@ public interface HyIntendDevelopementMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:50
*/
int insertSelective(@Param("record") HyIntendDevelopementMappingDO record);
@@ -22,4 +25,33 @@ public interface HyIntendDevelopementMappingMapper {
* dateTime:2023-05-29 03:50
*/
int updateByPrimaryKeySelective(@Param("record") HyIntendDevelopementMappingDO record);
/**
* 批量删除数据
* @param idList
* @return
*/
int deleteByOpenAreaIds(@Param("openAreaIdList") List<Long> idList, @Param("type") String type);
/**
* 删除战区对应的关联意向区域
* @param idList
* @param type
* @return
*/
int deleteByMappingIds(@Param("mappingIds") List<Long> idList, @Param("type") String type);
/**
*
* @param recordList
* @return
*/
int batchInsert(@Param("recordList") List<HyIntendDevelopementMappingDO> recordList);
/**
* 查询根据selectByMappingIdList集合
* @param mappingIdList
* @return
*/
List<ZoneCheckDTO> selectByMappingIdList(@Param("mappingIdList") List<Long> mappingIdList);
}

View File

@@ -16,7 +16,7 @@ public interface HyOpenAreaInfoMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:51
*/
int insertSelective(@Param("record") HyOpenAreaInfoDO record);
@@ -39,7 +39,8 @@ public interface HyOpenAreaInfoMapper {
* 查询所有
* @return
*/
List<HyOpenAreaInfoDO> queryByKeyword(@Param("keyword") String keyword, @Param("filterData") Boolean filterData);
List<HyOpenAreaInfoDO> queryByKeyword(@Param("keyword") String keyword,
@Param("filterData") Boolean filterData);
/**
* 查询所有一级城市 (所有省份+直辖市)
@@ -64,7 +65,37 @@ public interface HyOpenAreaInfoMapper {
* 查询子列表
* @return
*/
List<HyOpenAreaInfoDO> getChildrenList(@Param("type") String type , @Param("parentId") Long parentId);
List<HyOpenAreaInfoDO> getChildrenList(@Param("type") String type ,
@Param("parentId") Long parentId);
/**
* 更新城市昨天
* @param backgroundBanner
* @param detailBanner
* @param areaStatus
* @param updateUserId
* @param ids
* @return
*/
int batchUpdateById(@Param("backgroundBanner") String backgroundBanner,
@Param("detailBanner") String detailBanner,
@Param("areaStatus") String areaStatus,
@Param("updateUserId") String updateUserId,
@Param("ids") List<Long> ids);
int batchUpdateByParentId(@Param("backgroundBanner") String backgroundBanner,
@Param("detailBanner") String detailBanner,
@Param("areaStatus") String areaStatus,
@Param("updateUserId") String updateUserId,
@Param("parentIdList") List<Long> parentIdList);
/**
* 根据idList查询数据
* @param idList
* @return
*/
List<HyOpenAreaInfoDO> selectByIds(@Param("idList") List<Long> idList);

View File

@@ -231,14 +231,29 @@
<select id="getUserInfoById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
enterprise_user
enterprise_user
where
user_id = #{userId}
user_id = #{userId}
</select>
<select id="getUserInfoByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
enterprise_user
<where>
<if test="userIdList !=null and userIdList.size>0">
<foreach collection="userIdList" item="userId" open="and user_id in (" close=")" separator=",">
#{userId}
</foreach>
</if>
</where>
</select>
<update id="deleteUser">
update enterprise_user set deleted = 1 where user_id not in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
</update>

View File

@@ -14,9 +14,17 @@
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
</resultMap>
<sql id="Base_Column_List">
id, zone_name, associated_region_id, type, last_allot_user_id, deleted, create_time,
id, zone_name, associated_region_id, type, last_allot_user_id, deleted, create_time,
update_time, create_user_id, update_user_id
</sql>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_intend_dev_zone_info
where id = #{id}
</select>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_intend_dev_zone_info
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -111,4 +119,11 @@
</set>
where id = #{record.id}
</update>
<select id="getHyIntendDevZoneInfoList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_intend_dev_zone_info
where type = #{type}
</select>
</mapper>

View File

@@ -70,4 +70,64 @@
</set>
where id = #{record.id}
</update>
<delete id="deleteByOpenAreaIds">
delete from hy_intend_developement_mapping
<where>
<if test="type!=null and type!=''">
and type = #{type}
</if>
<if test="openAreaIdList!=null and openAreaIdList.size>0">
<foreach collection="openAreaIdList" open="and open_area_mapping_id in (" close=")" separator="," item="openAreaId">
#{openAreaId}
</foreach>
</if>
</where>
</delete>
<delete id="deleteByMappingIds">
delete from hy_intend_developement_mapping
<where>
<if test="type!=null and type!=''">
and type = #{type}
</if>
<if test="deleteByMappingIds!=null and deleteByMappingIds.size>0">
<foreach collection="deleteByMappingIds" open="and mapping_id in (" close=")" separator="," item="mappingId">
#{mappingId}
</foreach>
</if>
</where>
</delete>
<insert id="batchInsert">
insert into
hy_intend_developement_mapping
(
mapping_id,
open_area_mapping_id,
type
)
values
<foreach collection="recordList" item="record" separator=",">
(#{record.mappingId},
#{record.openAreaMappingId},
#{record.type}
</foreach>
</insert>
<select id="selectByMappingIdList" resultType="com.cool.store.dto.partner.ZoneCheckDTO">
select
a.open_area_mapping_id as openAreaMappingId,
b.zone_name as zoneName
from hy_intend_developement_mapping a inner join hy_intend_dev_zone_info b on a.mapping_id = b.id
<where>
<if test="mappingIdList!=null and mappingIdList.size>0">
<foreach collection="mappingIdList" open="and a.open_area_mapping_id in (" close=")" separator="," item="mappingId">
#{mappingId}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -15,7 +15,7 @@
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
</resultMap>
<sql id="Base_Column_List">
id, parent_id, area_name, area_path, background_banner, detail_banner, area_status,
id, parent_id, area_name, area_path, background_banner, detail_banner, area_status,
deleted, create_time, update_time, update_user_id
</sql>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id" useGeneratedKeys="true">
@@ -123,6 +123,59 @@
</update>
<update id="batchUpdateById">
update hy_open_area_info
<set>
<if test="backgroundBanner != null">
background_banner = #{backgroundBanner},
</if>
<if test="detailBanner != null">
detail_banner = #{detailBanner},
</if>
<if test="areaStatus != null">
area_status = #{areaStatus},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
</set>
<where>
<if test="ids !=null and ids.size>0">
<foreach collection="ids" item="id" open="and id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</update>
<update id="batchUpdateByParentId">
update hy_open_area_info
<set>
<if test="backgroundBanner != null">
background_banner = #{backgroundBanner},
</if>
<if test="detailBanner != null">
detail_banner = #{detailBanner},
</if>
<if test="areaStatus != null">
area_status = #{areaStatus},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
</set>
<where>
<if test="parentIdList !=null and parentIdList.size>0">
<foreach collection="parentIdList" item="parentId" open="and parent_id in (" close=")" separator=",">
#{parentId}
</foreach>
</if>
</where>
</update>
<select id="queryKeyOpenArea" resultMap="BaseResultMap">
select * from
hy_open_area_info
@@ -182,4 +235,17 @@
</where>
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from hy_open_area_info
<where>
<if test="idList !=null and idList.size>0">
<foreach collection="idList" item="id" open="and id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>