You've already forked FrameTour-BE
refactor(coupon): 移除优惠券相关模块代码
- 删除优惠券控制器相关类,包括 AppCouponController 和 CouponController - 移除优惠券记录控制器 CouponRecordController - 删除优惠券数据访问层接口及实现类 - 移除优惠券相关的实体类、请求响应对象 - 清理业务逻辑层中与优惠券相关的服务接口及实现 - 从 PriceBiz 中移除优惠券相关导入依赖 - 从任务类 DownloadNotificationTasker 中移除优惠券相关导入 - 删除优惠券相关的 MyBatis 映射文件
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
<?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.ycwl.basic.mapper.CouponMapper">
|
||||
<update id="updateStatus">
|
||||
UPDATE coupon
|
||||
SET status = IF(status = 1, 0, 1)
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
|
||||
SELECT
|
||||
c.id, scenic_id AS scenicId,
|
||||
c.name AS name, c.description AS description, c.countdown AS countdown, c.broadcast,
|
||||
config_ids AS configIds, discount_price AS discountPrice,
|
||||
type, discount_type AS discountType,
|
||||
c.status, c.create_at
|
||||
FROM coupon c
|
||||
<where>
|
||||
AND c.deleted = 0
|
||||
<if test="scenicId != null">AND scenic_id = #{scenicId}</if>
|
||||
<if test="name != null and name != ''">AND c.name = concat('%',#{name},'%')</if>
|
||||
<if test="type != null">AND type = #{type}</if>
|
||||
<if test="discountType != null">AND discount_type = #{discountType}</if>
|
||||
<if test="status != null">AND c.status = #{status}</if>
|
||||
<if test="createAtStart != null">AND create_at >= #{createAtStart}</if>
|
||||
<if test="createAtEnd != null">AND create_at <= #{createAtEnd}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_at DESC
|
||||
</select>
|
||||
<select id="getById" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
||||
SELECT id, scenic_id, name, description, countdown, broadcast, config_ids, discount_price, type, discount_type, status, create_at, deleted, deleted_at
|
||||
FROM coupon
|
||||
WHERE id = #{id} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO coupon (
|
||||
scenic_id, name, description, countdown, broadcast,
|
||||
config_ids, discount_price, type, discount_type,
|
||||
status, create_at, deleted, deleted_at
|
||||
) VALUES (
|
||||
#{scenicId}, #{name}, #{description}, #{countdown}, #{broadcast},
|
||||
#{configIds}, #{discountPrice}, #{type}, #{discountType},
|
||||
#{status}, #{createAt}, #{deleted}, #{deletedAt}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateById" parameterType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
||||
UPDATE coupon SET
|
||||
scenic_id = #{scenicId},
|
||||
name = #{name},
|
||||
description = #{description},
|
||||
countdown = #{countdown},
|
||||
broadcast = #{broadcast},
|
||||
config_ids = #{configIds},
|
||||
discount_price = #{discountPrice},
|
||||
type = #{type},
|
||||
discount_type = #{discountType},
|
||||
status = #{status},
|
||||
create_at = #{createAt},
|
||||
deleted = #{deleted},
|
||||
deleted_at = #{deletedAt}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
UPDATE coupon SET deleted = 1, deleted_at = NOW() WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectById" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
||||
SELECT id, scenic_id, name, description, countdown, broadcast, config_ids, discount_price, type, discount_type, status, create_at, deleted, deleted_at
|
||||
FROM coupon
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
||||
SELECT id, scenic_id, name, description, countdown, broadcast, config_ids, discount_price, type, discount_type, status, create_at, deleted, deleted_at
|
||||
FROM coupon
|
||||
WHERE deleted = 0
|
||||
ORDER BY create_at DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByScenicIdAndTypeAndStatus" resultType="com.ycwl.basic.model.pc.coupon.entity.CouponEntity">
|
||||
SELECT id, scenic_id, name, description, countdown, broadcast, config_ids, discount_price, type, discount_type, status, create_at, deleted, deleted_at
|
||||
FROM coupon
|
||||
WHERE scenic_id = #{scenicId} AND type = #{type} AND status = #{status} AND deleted = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,70 +0,0 @@
|
||||
<?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.ycwl.basic.mapper.CouponRecordMapper">
|
||||
<select id="queryByUserWithGoodsId"
|
||||
resultType="com.ycwl.basic.model.pc.couponRecord.entity.CouponRecordEntity">
|
||||
select * from coupon_record where deleted = 0 and member_id = #{memberId} and coupon_id in (select id from coupon where deleted = 0 and scenic_id = #{scenicId} and FIND_IN_SET(#{goodsId},config_ids))
|
||||
</select>
|
||||
|
||||
<select id="queryByMemberIdAndFaceId"
|
||||
resultType="com.ycwl.basic.model.pc.couponRecord.entity.CouponRecordEntity">
|
||||
select * from coupon_record where deleted = 0 and member_id = #{memberId} and face_id = #{faceId}
|
||||
</select>
|
||||
|
||||
<select id="queryByMemberIdAndFaceIdAndType"
|
||||
resultType="com.ycwl.basic.model.pc.couponRecord.entity.CouponRecordEntity">
|
||||
select cr.*
|
||||
from coupon_record cr
|
||||
inner join coupon c on cr.coupon_id = c.id
|
||||
where cr.deleted = 0 and c.deleted = 0 and cr.member_id = #{memberId} and cr.face_id = #{faceId} and c.type = #{type}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByPageQuery"
|
||||
resultType="com.ycwl.basic.model.pc.couponRecord.resp.CouponRecordPageResp">
|
||||
select
|
||||
cr.id,
|
||||
cr.coupon_id as couponId,
|
||||
c.name as couponName,
|
||||
c.type as couponType,
|
||||
CASE c.type
|
||||
WHEN 0 THEN '普通优惠券'
|
||||
WHEN 1 THEN '第一次推送'
|
||||
WHEN 2 THEN '第二次推送'
|
||||
WHEN 3 THEN '第三次推送'
|
||||
ELSE '未知类型'
|
||||
END as couponTypeName,
|
||||
cr.member_id as memberId,
|
||||
cr.face_id as faceId,
|
||||
c.scenic_id as scenicId,
|
||||
s.name as scenicName,
|
||||
cr.status,
|
||||
CASE cr.status
|
||||
WHEN 0 THEN '未使用'
|
||||
WHEN 1 THEN '已使用'
|
||||
ELSE '未知状态'
|
||||
END as statusName,
|
||||
cr.create_time as createTime,
|
||||
cr.used_time as usedTime,
|
||||
cr.used_order_id as usedOrderId
|
||||
from coupon_record cr
|
||||
inner join coupon c on cr.coupon_id = c.id
|
||||
inner join scenic s on c.scenic_id = s.id
|
||||
<where>
|
||||
and cr.deleted = 0 and c.deleted = 0
|
||||
<if test="scenicId != null">
|
||||
and c.scenic_id = #{scenicId}
|
||||
</if>
|
||||
<if test="couponName != null and couponName != ''">
|
||||
and c.name like concat('%', #{couponName}, '%')
|
||||
</if>
|
||||
<if test="couponType != null">
|
||||
and c.type = #{couponType}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and cr.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by cr.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user