feat:系统建店相关代码

refactor:鲜丰系统API回调优化
This commit is contained in:
guohb
2024-04-23 16:21:17 +08:00
parent ed964f4e5f
commit d446d87366
38 changed files with 2445 additions and 63 deletions

View File

@@ -72,4 +72,13 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
* @return
*/
Integer recyclePoint(@Param("pointId") Long pointId);
/**
* 根据shopId与lineId查找铺位信息
* @param lineId
* @param shopId
* @return
*/
PointInfoDO getDataByShopIdAndLineId(@Param("lineId") Long lineId,
@Param("shopId") Long shopId);
}

View File

@@ -100,4 +100,6 @@ public interface RegionMapper {
RegionDO getRegionByStoreId(@Param("storeId") String storeId);
RegionDO getBigRegionByRegionId(@Param("regionId") long regionId);
}

View File

@@ -0,0 +1,8 @@
package com.cool.store.mapper;
import com.cool.store.entity.SystemBuildingShopDO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.mapper;
import com.cool.store.entity.ThirdDepartmentDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 主应用移植,完整的使用去主应用找
*/
public interface ThirdDepartmentMapper {
/**
*
* 默认查询方法,通过主键获取所有字段的值
* dateTime:2024-04-02 04:42
*/
ThirdDepartmentDO selectByPrimaryKey(Long id);
/**
*
* 默认更新方法,根据主键物理删除
* dateTime:2024-04-02 04:42
*/
int deleteByPrimaryKey(Long id);
Integer deleteThirdDepartment(@Param("departmentCodes") List<String> departmentCodes);
void batchInsertOrUpdate(@Param("thirdDepartments") List<ThirdDepartmentDO> thirdDepartments);
List<ThirdDepartmentDO> listByDeptPrincipals(@Param("deptPrincipals") List<String> deptPrincipals);
List<ThirdDepartmentDO> listAllThirdDepartment();
ThirdDepartmentDO getByDepartmentCode(@Param("departmentCode") String departmentCode);
ThirdDepartmentDO getByName(@Param("name")String name);
}

View File

@@ -190,8 +190,16 @@
</foreach>
</if>
</select>
<select id="getDataByShopIdAndLineId" resultType="com.cool.store.entity.PointInfoDO">
SELECT
<include refid="allColumn"/>
FROM xfsg_point_info
WHERE shop_id = #{shopId}
AND line_id = #{lineId}
AND deleted = 0
</select>
<update id="recyclePoint">
<update id="recyclePoint">
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status = if(point_status = 6, 5, point_status)) where id = #{pointId}
</update>

View File

@@ -364,6 +364,16 @@
and store_id = #{storeId}
and region_type = 'store'
</select>
<select id="getBigRegionByRegionId" resultType="com.cool.store.entity.RegionDO">
select <include refid="fields"/>
from region_${enterpriseId}
where deleted = 0
and id = (
SELECT parent_id
FROM region_${enterpriseId}
WHERE id = #{regionId}
)
</select>
</mapper>

View File

@@ -0,0 +1,12 @@
<?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.SystemBuildingShopMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.SystemBuildingShopDO">
<id column="id" jdbcType="BIGINT" property="id" />
</resultMap>
<sql id="Base_Column_List">
</sql>
</mapper>

View File

@@ -0,0 +1,112 @@
<?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.ThirdDepartmentMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ThirdDepartmentDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="department_code" jdbcType="VARCHAR" property="departmentCode" />
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
<result column="dept_principal" jdbcType="VARCHAR" property="deptPrincipal" />
<result column="parent_department_code" jdbcType="VARCHAR" property="parentDepartmentCode" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, department_code,
department_name,
dept_principal,
parent_department_code,
create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from third_department_${enterpriseId}
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from third_department_${enterpriseId}
where id = #{id,jdbcType=BIGINT}
</delete>
<sql id="dynamicQuery">
<trim prefix="WHERE" prefixOverrides="AND | OR">
<if test="null != id">
and t.id = #{id,jdbcType=BIGINT}
</if>
<if test="null != departmentCode">
and t.department_code = #{departmentCode,jdbcType=VARCHAR}
</if>
<if test="null != departmentName">
and t.department_name = #{departmentName,jdbcType=VARCHAR}
</if>
<if test="null != deptPrincipal">
and t.dept_principal = #{deptPrincipal,jdbcType=VARCHAR}
</if>
<if test="null != parentDepartmentCode">
and t.parent_department_code = #{parentDepartmentCode,jdbcType=VARCHAR}
</if>
<if test="null != createTime">
and t.create_time = #{createTime,jdbcType=TIMESTAMP}
</if>
<if test="null != updateTime">
and t.update_time = #{updateTime,jdbcType=TIMESTAMP}
</if>
</trim>
</sql>
<delete id="deleteThirdDepartment">
delete from third_department_${enterpriseId}
where department_code in
<foreach collection="departmentCodes" item="departmentCode" open="(" separator="," close=")">
#{departmentCode}
</foreach>
</delete>
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
insert into third_department_${enterpriseId}
(
department_code,
department_name,
dept_principal,
parent_department_code,
create_time
) values
<foreach collection="thirdDepartments" item="thirdDepartment" separator=",">
(
#{thirdDepartment.departmentCode},
#{thirdDepartment.departmentName},
#{thirdDepartment.deptPrincipal},
#{thirdDepartment.parentDepartmentCode},
now()
)
</foreach>
ON DUPLICATE KEY UPDATE update_time=values(update_time),department_name=values(department_name),
dept_principal=values(dept_principal),parent_department_code=values(parent_department_code)
</insert>
<select id="listByDeptPrincipals" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
where dept_principal in
<foreach collection="deptPrincipals" item="deptPrincipal" open="(" separator="," close=")">
#{deptPrincipal}
</foreach>
</select>
<select id="listAllThirdDepartment" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
</select>
<select id="getByDepartmentCode" resultType="com.cool.store.entity.ThirdDepartmentDO">
select <include refid="Base_Column_List" />
from third_department_${enterpriseId}
where department_code = #{departmentCode}
</select>
<select id="getByName" resultType="com.cool.store.entity.ThirdDepartmentDO">
SELECT <include refid="Base_Column_List"/>
FROM third_department_${enterpriseId}
WHERE department_name = #{name}
</select>
</mapper>