feat:装修配置表
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
|
||||
import com.cool.store.mapper.decoration.DecorationTeamConfigMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class DecorationTeamConfigDAO {
|
||||
|
||||
@Resource
|
||||
private DecorationTeamConfigMapper decorationTeamConfigMapper;
|
||||
|
||||
public void addTeam(DecorationTeamConfigDO decorationTeamConfigDO){
|
||||
decorationTeamConfigMapper.insertSelective(decorationTeamConfigDO);
|
||||
}
|
||||
|
||||
public void updateTeam(DecorationTeamConfigDO decorationTeamConfigDO){
|
||||
decorationTeamConfigMapper.updateByPrimaryKeySelective(decorationTeamConfigDO);
|
||||
}
|
||||
|
||||
public DecorationTeamConfigDO getById(Long id){
|
||||
if (id == null){
|
||||
return null;
|
||||
}
|
||||
return decorationTeamConfigMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.cool.store.mapper.decoration.ShopDecorationAssignMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class ShopDecorationAssignDAO {
|
||||
|
||||
@Resource
|
||||
private ShopDecorationAssignMapper shopDecorationAssignMapper;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.cool.store.dao.decoration;
|
||||
|
||||
import com.cool.store.entity.decoration.TeamAreaMappingDO;
|
||||
import com.cool.store.mapper.decoration.TeamAreaMappingMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/10/29 15:08
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class TeamAreaMappingDAO {
|
||||
|
||||
private TeamAreaMappingMapper teamAreaMappingMapper;
|
||||
|
||||
public void batchInsert(Long teamId,List<Long> cityId){
|
||||
if (teamId == null || CollectionUtils.isEmpty(cityId)){
|
||||
return;
|
||||
}
|
||||
List<TeamAreaMappingDO> list = new ArrayList<>();
|
||||
cityId.forEach(x->{
|
||||
TeamAreaMappingDO teamAreaMappingDO = new TeamAreaMappingDO();
|
||||
teamAreaMappingDO.setTeamId(teamId);
|
||||
teamAreaMappingDO.setOpenCityId(x);
|
||||
list.add(teamAreaMappingDO);
|
||||
});
|
||||
teamAreaMappingMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
public int deletedByTeamId(Long teamId){
|
||||
if (teamId == null){
|
||||
return 0;
|
||||
}
|
||||
return teamAreaMappingMapper.deletedByTeamId(teamId);
|
||||
}
|
||||
|
||||
public int deletedIds(List<Long> ids){
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
return 0;
|
||||
}
|
||||
return teamAreaMappingMapper.deletedIds(ids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface DecorationTeamConfigMapper extends Mapper<DecorationTeamConfigDO> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.entity.decoration.ShopDecorationAssignDO;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface ShopDecorationAssignMapper extends Mapper<ShopDecorationAssignDO> {
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.cool.store.mapper.decoration;
|
||||
|
||||
import com.cool.store.dto.decoration.TeamAreaMappingDTO;
|
||||
import com.cool.store.entity.decoration.TeamAreaMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TeamAreaMappingMapper extends Mapper<TeamAreaMappingDO> {
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Integer batchInsert(@Param("list") List<TeamAreaMappingDO> list);
|
||||
/**
|
||||
* 根据团队id删除 更新团队id时候删除
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
Integer deletedByTeamId(@Param("teamId") Long teamId);
|
||||
|
||||
/**
|
||||
* 根据ids删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Integer deletedIds(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据城市id查询
|
||||
* @param cityId
|
||||
* @return
|
||||
*/
|
||||
TeamAreaMappingDO getByCityId(@Param("cityId") Long cityId);
|
||||
|
||||
/**
|
||||
* 根据团队id批量查询
|
||||
* @param teamIdList
|
||||
* @return
|
||||
*/
|
||||
List<TeamAreaMappingDTO> listByTeamIdList(@Param("teamIdList") List<Long> teamIdList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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.decoration.DecorationTeamConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.DecorationTeamConfigDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="team_name" jdbcType="VARCHAR" property="teamName" />
|
||||
<result column="team_code" jdbcType="VARCHAR" property="teamCode" />
|
||||
<result column="use_system" jdbcType="TINYINT" property="useSystem" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="TINYINT" property="deleted" />
|
||||
</resultMap>
|
||||
</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.decoration.ShopDecorationAssignMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.ShopDecorationAssignDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="decoration_desc_status" jdbcType="TINYINT" property="decorationDescStatus" />
|
||||
<result column="decoration_team_id" jdbcType="BIGINT" property="decorationTeamId" />
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
|
||||
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
|
||||
</resultMap>
|
||||
</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.decoration.TeamAreaMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.decoration.TeamAreaMappingDO">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="team_id" jdbcType="BIGINT" property="teamId" />
|
||||
<result column="open_city_id" jdbcType="BIGINT" property="openCityId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO zxjp_team_area_mapping (
|
||||
team_id,
|
||||
open_city_id
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.teamId},
|
||||
#{item.openCityId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 根据团队id删除 更新团队id时候删除 -->
|
||||
<delete id="deletedByTeamId" parameterType="java.lang.Long">
|
||||
DELETE FROM zxjp_team_area_mapping
|
||||
WHERE team_id = #{teamId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ids删除 -->
|
||||
<delete id="deletedIds" parameterType="java.util.List">
|
||||
DELETE FROM zxjp_team_area_mapping
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getByCityId" parameterType="java.lang.Long" resultType="com.cool.store.entity.decoration.TeamAreaMappingDO">
|
||||
SELECT
|
||||
*
|
||||
FROM zxjp_team_area_mapping
|
||||
WHERE open_city_id = #{cityId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="listByTeamIdList" parameterType="java.util.List" resultType="com.cool.store.dto.decoration.TeamAreaMappingDTO">
|
||||
SELECT
|
||||
a.team_id as teamId,
|
||||
a.open_city_id as openCityId,
|
||||
b.area_name as openCityName
|
||||
FROM zxjp_team_area_mapping a
|
||||
left join xfsg_open_area_info b on a.open_city_id = b.id
|
||||
WHERE a.team_id IN
|
||||
<foreach collection="teamIdList" item="teamId" open="(" separator="," close=")">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user