fix
This commit is contained in:
@@ -238,15 +238,43 @@
|
||||
c.picture_obj as pictureObj,
|
||||
a.point_area as pointArea,
|
||||
c.landlord_mobile as landlordMobile,
|
||||
c.month_rent as monthRent
|
||||
c.month_rent as monthRent,
|
||||
d.store_name as openShopName
|
||||
from xfsg_point_info a
|
||||
left join xfsg_point_recommend b on a.id = b.point_id
|
||||
left JOIN xfsg_shop_info b ON a.shop_id = b.id
|
||||
LEFT JOIN xfsg_point_detail_info c on a.id = c.point_id
|
||||
left JOIN store_${enterpriseId} d ON b.shop_code = d.store_num
|
||||
<if test="request.areaCode!=null and request!=''">
|
||||
and (a.province_code = #{request.areaCode} or a.city_code = #{request.areaCode} or a.district_code =
|
||||
#{request.areaCode})
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPointByOpportunityPointCode" resultType="com.cool.store.vo.point.MiniPointPageVO">
|
||||
select a.id as pointId,
|
||||
a.point_name as pointName,
|
||||
a.point_code as pointCode,
|
||||
a.longitude as longitude,
|
||||
a.latitude as latitude,
|
||||
a.address as address,
|
||||
a.create_time as createTime,
|
||||
a.opportunity_point_code as opportunityPointCode,
|
||||
a.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
a.point_area as pointArea,
|
||||
c.landlord_mobile as landlordMobile,
|
||||
c.month_rent as monthRent
|
||||
from xfsg_point_info a
|
||||
LEFT JOIN xfsg_point_detail_info c on a.id = c.point_id
|
||||
where a.opportunity_point_code = #{code}
|
||||
</select>
|
||||
<select id="getShopByOpportunityPointCode" resultType="com.cool.store.dto.MiniShopDTO">
|
||||
select c.shop_name as shopName,
|
||||
c.store_address as address
|
||||
from xfsg_point_info a
|
||||
inner join xfsg_shop b on a.shop_id = b.id
|
||||
inner join store_${enterpriseId} c on b.shop_code = c.store_num
|
||||
where a.opportunity_point_code = #{code}
|
||||
</select>
|
||||
|
||||
<update id="recyclePoint">
|
||||
update xfsg_point_info set line_id = null, shop_id = null, select_status = 0, update_time = now(), point_status
|
||||
|
||||
@@ -1,207 +1,211 @@
|
||||
<?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.PointRecommendMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId" />
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId" />
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
|
||||
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||
<result column="point_id" jdbcType="BIGINT" property="pointId"/>
|
||||
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager"/>
|
||||
<result column="status" jdbcType="TINYINT" property="status"/>
|
||||
<result column="reason" jdbcType="VARCHAR" property="reason"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
</sql>
|
||||
<sql id="allColumn">
|
||||
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0
|
||||
<if test="excludeStatus != null and excludeStatus.size()>0">
|
||||
and status not in
|
||||
<foreach collection="excludeStatus" separator="," open="(" close=")" item="status">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateShopPointRecommendStatus">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0
|
||||
<if test="excludeStatus != null and excludeStatus.size()>0">
|
||||
and status not in
|
||||
<foreach collection="excludeStatus" separator="," open="(" close=")" item="status">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="updateRecommendStatusByStatusAndPointId">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0 and status in
|
||||
<foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateRecommendStatusByStatusAndPointId">
|
||||
update xfsg_point_recommend set status = #{status} where point_id = #{pointId} and deleted = 0 and status in
|
||||
<foreach collection="statusList" item="status" index="index" open="(" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getPushShopNumMap" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||
select
|
||||
line_id as lineId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and line_id in
|
||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
group by line_id
|
||||
</select>
|
||||
<select id="getPushShopNumMap" resultType="com.cool.store.dto.point.LineCountDTO">
|
||||
select
|
||||
line_id as lineId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and line_id in
|
||||
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
group by line_id
|
||||
</select>
|
||||
|
||||
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
group by shop_id
|
||||
</select>
|
||||
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
|
||||
select
|
||||
shop_id as shopId,
|
||||
count(1) as recommendShopNum
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
deleted = 0 and shop_id in
|
||||
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
group by shop_id
|
||||
</select>
|
||||
|
||||
<select id="getRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
line_id = #{lineId} and deleted = 0
|
||||
</select>
|
||||
<select id="getRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
line_id = #{lineId} and deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
point_id,
|
||||
line_id,
|
||||
development_manager,
|
||||
status,
|
||||
reason
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
shop_id = #{shopId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="recommendList" item="item" index="index" separator=";">
|
||||
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
|
||||
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert">
|
||||
<foreach collection="recommendList" item="item" index="index" separator=";">
|
||||
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
|
||||
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="turnLineUpdateRecommendStatus">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
deleted = if(status = 1, 1, deleted),
|
||||
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
|
||||
where
|
||||
shop_id = #{shopId}
|
||||
</update>
|
||||
<update id="turnLineUpdateRecommendStatus">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
deleted = if(status = 1, 1, deleted),
|
||||
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
|
||||
where
|
||||
shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
|
||||
select
|
||||
p.id as pointId,
|
||||
pr.line_id as lineId,
|
||||
p.point_name as pointName,
|
||||
p.point_code as pointCode,
|
||||
p.region_id as regionId,
|
||||
p.longitude as longitude,
|
||||
p.latitude as latitude,
|
||||
p.address as address,
|
||||
p.point_score as pointScore,
|
||||
p.point_area as pointArea,
|
||||
p.point_status as pointStatus,
|
||||
p.select_status as selectStatus,
|
||||
p.create_time as createTime,
|
||||
p.opportunity_point_code as opportunityPointCode,
|
||||
p.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
pr.status as recommendStatus
|
||||
from
|
||||
xfsg_point_recommend pr
|
||||
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
|
||||
select
|
||||
p.id as pointId,
|
||||
pr.line_id as lineId,
|
||||
p.point_name as pointName,
|
||||
p.point_code as pointCode,
|
||||
p.region_id as regionId,
|
||||
p.longitude as longitude,
|
||||
p.latitude as latitude,
|
||||
p.address as address,
|
||||
p.point_score as pointScore,
|
||||
p.point_area as pointArea,
|
||||
p.point_status as pointStatus,
|
||||
p.select_status as selectStatus,
|
||||
p.create_time as createTime,
|
||||
p.opportunity_point_code as opportunityPointCode,
|
||||
p.opportunity_point_name as opportunityPointName,
|
||||
c.picture_obj as pictureObj,
|
||||
pr.status as recommendStatus,
|
||||
e.store_name as shopName
|
||||
from
|
||||
xfsg_point_recommend pr
|
||||
inner join xfsg_point_info p on p.id = pr.point_id
|
||||
left join xfsg_point_detail_info c on p.id = c.point_id
|
||||
where
|
||||
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
|
||||
<if test="request.status != null and request.status == 1">
|
||||
and pr.status = 1 and p.select_status = 0
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 2">
|
||||
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 3">
|
||||
and pr.status in (5, 6)
|
||||
</if>
|
||||
<if test="request.areaCode!=null and request.areaCode !=''">
|
||||
and (p.province_code = #{request.areaCode} or p.city_code = #{request.areaCode} or p.district_code = #{request.areaCode})
|
||||
</if>
|
||||
left JOIN xfsg_shop_info d ON c.shop_id = d.id
|
||||
left JOIN store_${enterpriseId} e ON d.shop_code = e.store_num
|
||||
where
|
||||
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
|
||||
<if test="request.status != null and request.status == 1">
|
||||
and pr.status = 1 and p.select_status = 0
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 2">
|
||||
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
|
||||
</if>
|
||||
<if test="request.status != null and request.status == 3">
|
||||
and pr.status in (5, 6)
|
||||
</if>
|
||||
<if test="request.areaCode!=null and request.areaCode !=''">
|
||||
and (p.province_code = #{request.areaCode} or p.city_code = #{request.areaCode} or p.district_code =
|
||||
#{request.areaCode})
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<update id="updateStatusByPointIdAndLineId">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = if(shop_id = #{shopId}, 2, 3)
|
||||
where point_id = #{pointId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
<update id="updateStatusByPointIdAndLineId">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = if(shop_id = #{shopId}, 2, 3)
|
||||
where point_id = #{pointId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<update id="rejectPoint">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = 5,
|
||||
reason = #{reason}
|
||||
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
<update id="rejectPoint">
|
||||
update
|
||||
xfsg_point_recommend
|
||||
set
|
||||
status = 5,
|
||||
reason = #{reason}
|
||||
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
|
||||
</update>
|
||||
|
||||
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
<where>
|
||||
and (shop_id = 0 or shop_id is null)
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
where
|
||||
point_id = #{pointId} and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="allColumn"/>
|
||||
from
|
||||
xfsg_point_recommend
|
||||
<where>
|
||||
and (shop_id = 0 or shop_id is null)
|
||||
<if test="lineId!=null">
|
||||
and line_id = #{lineId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateShopId">
|
||||
update xfsg_point_recommend
|
||||
set
|
||||
shop_id = case id
|
||||
<foreach collection="recommendList" item="item" index="index" >
|
||||
when #{item.id} then #{item.shopId}
|
||||
</foreach>
|
||||
end
|
||||
where
|
||||
id in
|
||||
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
|
||||
#{entity.id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="batchUpdateShopId">
|
||||
update xfsg_point_recommend
|
||||
set
|
||||
shop_id = case id
|
||||
<foreach collection="recommendList" item="item" index="index">
|
||||
when #{item.id} then #{item.shopId}
|
||||
</foreach>
|
||||
end
|
||||
where
|
||||
id in
|
||||
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
|
||||
#{entity.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user