|
@@ -17,7 +17,24 @@
|
|
|
|
|
|
<sql id="cmSvipHistoryJoins">
|
|
<sql id="cmSvipHistoryJoins">
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+ <insert id="giveVip">
|
|
|
|
+ insert into cm_svip_user (userId, beginTime, endTime, delFlag, updateTime)
|
|
|
|
+ values (#{userId}, #{beginTime}, #{endTime}, 0, #{beginTime})
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertHistory">
|
|
|
|
+ insert into cm_svip_history(userId, packageId, beginTime, endTime, payStatus, payWay, price, userBeans, payTime)
|
|
|
|
+ values (#{userId}, 0, #{beginTime}, #{endTime}, 1, #{payWay}, 0, 0, #{payTime})
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="updateVip">
|
|
|
|
+ UPDATE cm_svip_user
|
|
|
|
+ SET
|
|
|
|
+ <if test="beginTime != null">
|
|
|
|
+ beginTime = #{beginTime},
|
|
|
|
+ </if>
|
|
|
|
+ endTime = #{endTime},
|
|
|
|
+ updateTime = now()
|
|
|
|
+ WHERE userId = #{userId}
|
|
|
|
+ </update>
|
|
<select id="get" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
|
|
<select id="get" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
|
|
SELECT
|
|
SELECT
|
|
<include refid="cmSvipHistoryColumns"/>
|
|
<include refid="cmSvipHistoryColumns"/>
|
|
@@ -102,9 +119,12 @@
|
|
<if test="startEndTime != null and startEndTime != '' and endEndTime != null and endEndTime != ''">
|
|
<if test="startEndTime != null and startEndTime != '' and endEndTime != null and endEndTime != ''">
|
|
and (cs.endTime between #{startEndTime} and #{endEndTime})
|
|
and (cs.endTime between #{startEndTime} and #{endEndTime})
|
|
</if>
|
|
</if>
|
|
- <if test="packageId != null">
|
|
|
|
|
|
+ <if test="packageId != null and packageId != 0">
|
|
and cp.duration = #{packageId}
|
|
and cp.duration = #{packageId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="packageId == 0">
|
|
|
|
+ and cs.packageId = 0
|
|
|
|
+ </if>
|
|
<if test='status == "1"'>
|
|
<if test='status == "1"'>
|
|
and (NOW() between cs.beginTime and cs.endTime)
|
|
and (NOW() between cs.beginTime and cs.endTime)
|
|
</if>
|
|
</if>
|
|
@@ -124,7 +144,6 @@
|
|
and endTime > now()
|
|
and endTime > now()
|
|
</select>
|
|
</select>
|
|
|
|
|
|
-
|
|
|
|
<select id="superFind" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
|
|
<select id="superFind" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
|
|
SELECT u.name as clubName, u.username as linkMan, u.bindMobile as mobile,
|
|
SELECT u.name as clubName, u.username as linkMan, u.bindMobile as mobile,
|
|
cs.userId,cs.beginTime,cs.endTime,cs.packageId
|
|
cs.userId,cs.beginTime,cs.endTime,cs.packageId
|
|
@@ -150,9 +169,12 @@
|
|
<if test="startEndTime !=null and startEndTime!='' and endEndTime!=null and endEndTime!=''">
|
|
<if test="startEndTime !=null and startEndTime!='' and endEndTime!=null and endEndTime!=''">
|
|
and (cu.endTime between #{startEndTime} and #{endEndTime})
|
|
and (cu.endTime between #{startEndTime} and #{endEndTime})
|
|
</if>
|
|
</if>
|
|
- <if test="packageId !=null and packageId != ''">
|
|
|
|
|
|
+ <if test="packageId !=null and packageId != '' and packageId != 0">
|
|
and cp.duration = #{packageId}
|
|
and cp.duration = #{packageId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="packageId == 0">
|
|
|
|
+ and cs.packageId = 0
|
|
|
|
+ </if>
|
|
<if test='status == "1"'>
|
|
<if test='status == "1"'>
|
|
and cu.endTime > NOW()
|
|
and cu.endTime > NOW()
|
|
</if>
|
|
</if>
|
|
@@ -182,5 +204,11 @@
|
|
from cm_svip_package
|
|
from cm_svip_package
|
|
where id = #{packageId}
|
|
where id = #{packageId}
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="findVipUser" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
|
|
|
|
+ select beginTime, endTime, updateTime, userId
|
|
|
|
+ from cm_svip_user
|
|
|
|
+ where userId = #{userId}
|
|
|
|
+ and delflag = 0
|
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|