|
@@ -248,26 +248,26 @@
|
|
</select>
|
|
</select>
|
|
<select id="findUserList" resultType="com.caimei365.manager.entity.caimei.CmUser">
|
|
<select id="findUserList" resultType="com.caimei365.manager.entity.caimei.CmUser">
|
|
SELECT
|
|
SELECT
|
|
- clubID as clubId,
|
|
|
|
- userID as userId,
|
|
|
|
- name,
|
|
|
|
- sname AS shortName,
|
|
|
|
- linkMan,
|
|
|
|
- contractMobile as contractMobile
|
|
|
|
- FROM
|
|
|
|
- club
|
|
|
|
|
|
+ c.clubID as clubId,
|
|
|
|
+ c.userID as userId,
|
|
|
|
+ c.name,
|
|
|
|
+ c.sname AS shortName,
|
|
|
|
+ u.userName as linkMan,
|
|
|
|
+ c.contractMobile as contractMobile
|
|
|
|
+ FROM club c
|
|
|
|
+ left join user u on u.userID = c.userID
|
|
WHERE
|
|
WHERE
|
|
- status IN (1, 90)
|
|
|
|
|
|
+ c.status IN (1, 90)
|
|
<if test="clubId != null and clubId != ''">
|
|
<if test="clubId != null and clubId != ''">
|
|
- AND clubId = #{clubId}
|
|
|
|
|
|
+ AND c.clubId = #{clubId}
|
|
</if>
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND name LIKE CONCAT('%',#{name},'%')
|
|
|
|
|
|
+ AND c.name LIKE CONCAT('%',#{name},'%')
|
|
</if>
|
|
</if>
|
|
<if test="shortName != null and shortName != ''">
|
|
<if test="shortName != null and shortName != ''">
|
|
- AND sname LIKE CONCAT('%',#{shortName},'%')
|
|
|
|
|
|
+ AND c.sname LIKE CONCAT('%',#{shortName},'%')
|
|
</if>
|
|
</if>
|
|
- ORDER BY clubId ASC
|
|
|
|
|
|
+ ORDER BY c.clubId ASC
|
|
</select>
|
|
</select>
|
|
<select id="findVipUser" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipHistory">
|
|
<select id="findVipUser" resultType="com.caimei365.manager.entity.caimei.svip.CmSvipHistory">
|
|
select beginTime, endTime, updateTime, userId
|
|
select beginTime, endTime, updateTime, userId
|
|
@@ -515,10 +515,13 @@
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<select id="findCouponList" resultType="com.caimei365.manager.entity.caimei.svip.CmVipCoupon">
|
|
<select id="findCouponList" resultType="com.caimei365.manager.entity.caimei.svip.CmVipCoupon">
|
|
- SELECT cs.id, cs.useTime, cs.status, cs.updateTime, cs.delFlag
|
|
|
|
|
|
+ SELECT distinct cs.id, cs.useTime, cs.status, cs.updateTime, cs.delFlag
|
|
FROM cm_svip_coupon_month cs
|
|
FROM cm_svip_coupon_month cs
|
|
|
|
+ LEFT JOIN cm_svip_coupon csc ON csc.montId = cs.id
|
|
|
|
+ LEFT JOIN cm_coupon cc ON cc.id = csc.couponId
|
|
<where>
|
|
<where>
|
|
AND cs.delFlag = 0
|
|
AND cs.delFlag = 0
|
|
|
|
+ AND cc.delFlag = 0 AND cc.vipFlag = 1
|
|
<if test="startDate!=null and startDate!=''">
|
|
<if test="startDate!=null and startDate!=''">
|
|
AND cs.useTime <![CDATA[ >= ]]> #{startDate}
|
|
AND cs.useTime <![CDATA[ >= ]]> #{startDate}
|
|
</if>
|
|
</if>
|
|
@@ -529,17 +532,20 @@
|
|
<if test="status!=null and status!=''">
|
|
<if test="status!=null and status!=''">
|
|
<if test='status == "0"'>
|
|
<if test='status == "0"'>
|
|
AND cs.status != '2'
|
|
AND cs.status != '2'
|
|
- AND cs.useTime <![CDATA[ > ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
|
|
|
|
+ AND NOW() <![CDATA[ < ]]> cc.startDate
|
|
|
|
+ # AND cs.useTime <![CDATA[ > ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
</if>
|
|
</if>
|
|
<if test='status == "1"'>
|
|
<if test='status == "1"'>
|
|
AND cs.status != '2'
|
|
AND cs.status != '2'
|
|
- AND cs.useTime <![CDATA[ = ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
|
|
|
|
+ AND NOW() BETWEEN cc.startDate AND cc.endDate
|
|
|
|
+ # AND cs.useTime <![CDATA[ = ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
</if>
|
|
</if>
|
|
<if test='status == "2"'>
|
|
<if test='status == "2"'>
|
|
AND cs.status = '2'
|
|
AND cs.status = '2'
|
|
</if>
|
|
</if>
|
|
<if test='status == "3"'>
|
|
<if test='status == "3"'>
|
|
AND cs.status != '2'
|
|
AND cs.status != '2'
|
|
|
|
+ AND NOW() <![CDATA[ > ]]> cc.endDate
|
|
AND cs.useTime <![CDATA[ < ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
AND cs.useTime <![CDATA[ < ]]> DATE_FORMAT(NOW(), '%Y-%m')
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
@@ -607,12 +613,12 @@
|
|
<update id="delSvipCoupon">
|
|
<update id="delSvipCoupon">
|
|
update cm_svip_coupon
|
|
update cm_svip_coupon
|
|
set delFlag = 1
|
|
set delFlag = 1
|
|
- where id = #{id}
|
|
|
|
|
|
+ where couponId = #{id}
|
|
</update>
|
|
</update>
|
|
<update id="delSvipProduct">
|
|
<update id="delSvipProduct">
|
|
update cm_coupon_product
|
|
update cm_coupon_product
|
|
set delFlag = 1
|
|
set delFlag = 1
|
|
- where id = #{id}
|
|
|
|
|
|
+ where couponId = #{id}
|
|
</update>
|
|
</update>
|
|
<select id="getBindCoupons" resultType="java.lang.String">
|
|
<select id="getBindCoupons" resultType="java.lang.String">
|
|
SELECT couponId from cm_svip_coupon WHERE montId = #{montId} AND delFlag=0
|
|
SELECT couponId from cm_svip_coupon WHERE montId = #{montId} AND delFlag=0
|