|
@@ -1,7 +1,7 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei.modules.coupon.dao.CmCouponDao">
|
|
<mapper namespace="com.caimei.modules.coupon.dao.CmCouponDao">
|
|
-
|
|
|
|
|
|
+
|
|
<sql id="cmCouponColumns">
|
|
<sql id="cmCouponColumns">
|
|
a.id AS "id",
|
|
a.id AS "id",
|
|
a.name AS "name",
|
|
a.name AS "name",
|
|
@@ -26,22 +26,23 @@
|
|
a.moneyCouponFlag AS "moneyCouponFlag",
|
|
a.moneyCouponFlag AS "moneyCouponFlag",
|
|
a.moneyCouponType as "moneyCouponType",
|
|
a.moneyCouponType as "moneyCouponType",
|
|
a.createDate AS "createDate",
|
|
a.createDate AS "createDate",
|
|
|
|
+ a.couponPayWay as "couponPayWay",
|
|
a.delFlag AS "delFlag"
|
|
a.delFlag AS "delFlag"
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+
|
|
<sql id="cmCouponJoins">
|
|
<sql id="cmCouponJoins">
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="get" resultType="CmCoupon">
|
|
<select id="get" resultType="CmCoupon">
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="cmCouponColumns"/>
|
|
<include refid="cmCouponColumns"/>
|
|
FROM cm_coupon a
|
|
FROM cm_coupon a
|
|
<include refid="cmCouponJoins"/>
|
|
<include refid="cmCouponJoins"/>
|
|
WHERE a.id = #{id}
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findList" resultType="CmCoupon">
|
|
<select id="findList" resultType="CmCoupon">
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="cmCouponColumns"/>,
|
|
<include refid="cmCouponColumns"/>,
|
|
u.name AS "clubName",
|
|
u.name AS "clubName",
|
|
s.name AS "shopName"
|
|
s.name AS "shopName"
|
|
@@ -58,8 +59,11 @@
|
|
<if test="moneyCouponFlag != null and moneyCouponFlag > 0">
|
|
<if test="moneyCouponFlag != null and moneyCouponFlag > 0">
|
|
AND a.moneyCouponFlag = #{moneyCouponFlag}
|
|
AND a.moneyCouponFlag = #{moneyCouponFlag}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="couponPayWay != null">
|
|
|
|
+ AND a.couponPayWay = #{couponPayWay}
|
|
|
|
+ </if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND a.name LIKE
|
|
|
|
|
|
+ AND a.name LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
@@ -119,15 +123,15 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findAllList" resultType="CmCoupon">
|
|
<select id="findAllList" resultType="CmCoupon">
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="cmCouponColumns"/>
|
|
<include refid="cmCouponColumns"/>
|
|
FROM cm_coupon a
|
|
FROM cm_coupon a
|
|
<include refid="cmCouponJoins"/>
|
|
<include refid="cmCouponJoins"/>
|
|
<where>
|
|
<where>
|
|
-
|
|
|
|
- </where>
|
|
|
|
|
|
+
|
|
|
|
+ </where>
|
|
<choose>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
ORDER BY ${page.orderBy}
|
|
@@ -136,10 +140,11 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<insert id="insert" parameterType="CmCoupon" keyProperty="id" useGeneratedKeys="true">
|
|
<insert id="insert" parameterType="CmCoupon" keyProperty="id" useGeneratedKeys="true">
|
|
INSERT INTO cm_coupon(
|
|
INSERT INTO cm_coupon(
|
|
name,
|
|
name,
|
|
|
|
+ couponPayWay,
|
|
couponAmount,
|
|
couponAmount,
|
|
touchPrice,
|
|
touchPrice,
|
|
startDate,
|
|
startDate,
|
|
@@ -164,6 +169,7 @@
|
|
delFlag
|
|
delFlag
|
|
) VALUES (
|
|
) VALUES (
|
|
#{name},
|
|
#{name},
|
|
|
|
+ #{couponPayWay},
|
|
#{couponAmount},
|
|
#{couponAmount},
|
|
#{touchPrice},
|
|
#{touchPrice},
|
|
#{startDate},
|
|
#{startDate},
|
|
@@ -188,10 +194,11 @@
|
|
#{delFlag}
|
|
#{delFlag}
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
-
|
|
|
|
|
|
+
|
|
<update id="update">
|
|
<update id="update">
|
|
- UPDATE cm_coupon SET
|
|
|
|
|
|
+ UPDATE cm_coupon SET
|
|
name = #{name},
|
|
name = #{name},
|
|
|
|
+ couponPayWay = #{couponPayWay},
|
|
couponAmount = #{couponAmount},
|
|
couponAmount = #{couponAmount},
|
|
touchPrice = #{touchPrice},
|
|
touchPrice = #{touchPrice},
|
|
startDate = #{startDate},
|
|
startDate = #{startDate},
|
|
@@ -213,7 +220,7 @@
|
|
moneyCouponType = #{moneyCouponType}
|
|
moneyCouponType = #{moneyCouponType}
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
<delete id="delete">
|
|
<delete id="delete">
|
|
DELETE FROM cm_coupon
|
|
DELETE FROM cm_coupon
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
@@ -366,7 +373,7 @@
|
|
<select id="findRedemptionCodeNum" resultType="integer">
|
|
<select id="findRedemptionCodeNum" resultType="integer">
|
|
SELECT COUNT(id) FROM cm_coupon_redemption_code WHERE couponId = #{couponId}
|
|
SELECT COUNT(id) FROM cm_coupon_redemption_code WHERE couponId = #{couponId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findByRedemptionCode" resultType="com.caimei.modules.coupon.entity.CmCouponRedemptionCode">
|
|
<select id="findByRedemptionCode" resultType="com.caimei.modules.coupon.entity.CmCouponRedemptionCode">
|
|
SELECT
|
|
SELECT
|
|
`id`,
|
|
`id`,
|
|
@@ -557,5 +564,5 @@
|
|
WHERE
|
|
WHERE
|
|
id = #{clubCouponId}
|
|
id = #{clubCouponId}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|