|
@@ -1,6 +1,36 @@
|
|
|
<?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.caimei365.user.mapper.MessageCenterMapper">
|
|
|
+
|
|
|
+ <resultMap id="MessageCenterResult" type="com.caimei365.user.model.vo.MessageCenter">
|
|
|
+ <id property="id" column="id" />
|
|
|
+ <result property="shopId" column="shopID" />
|
|
|
+ <result property="clubId" column="clubId" />
|
|
|
+ <result property="orderId" column="orderId" />
|
|
|
+ <result property="userType" column="userType" />
|
|
|
+ <result property="messageType" column="messageType" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="time" column="time" />
|
|
|
+ <result property="accountType" column="accountType" />
|
|
|
+ <result property="couponType" column="couponType" />
|
|
|
+ <result property="couponFee" column="couponFee" />
|
|
|
+ <result property="mainImage" column="mainImage" />
|
|
|
+ <result property="onlinePayFlag" column="onlinePayFlag" />
|
|
|
+ <result property="productName" column="productName" />
|
|
|
+ <result property="shopMessType" column="shopMessType" />
|
|
|
+ <result property="shopTieredType" column="shopTieredType" />
|
|
|
+ <result property="orderMessageType" column="orderMessageType" />
|
|
|
+ <result property="saved" column="saved" />
|
|
|
+ <result property="couponMessageType" column="couponMessageType" />
|
|
|
+ <result property="productCount" column="productCount" />
|
|
|
+ <result property="refundType" column="refundType" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="productId" column="productId" />
|
|
|
+ <result property="shopName" column="shopName" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<insert id="addMessageCenter">
|
|
|
INSERT INTO message_center (shopID, clubID, userType, messageType, content,time,accountType,couponType,couponFee,couponMessageType,ShopMessType)
|
|
|
VALUES (#{shopId}, #{clubId}, #{userType}, #{messageType}, #{content},#{time},#{accountType},#{couponType},#{couponFee},#{couponMessageType},#{shopMessType})
|
|
@@ -238,5 +268,84 @@
|
|
|
<select id="shopName" resultType="java.lang.String">
|
|
|
SELECT name FROM `shop` WHERE shopID=#{shopID}
|
|
|
</select>
|
|
|
+ <select id="getMessageCenterListDay" resultType="java.lang.Integer">
|
|
|
+ select distinct d.shopID as shopID from cm_receipt as r
|
|
|
+ LEFT JOIN cm_discern_receipt as d on r.receiptID=d.id
|
|
|
+ LEFT JOIN shop as s on d.shopID=s.shopID
|
|
|
+ WHERE receStatct=0 and DATEDIFF(r.dateStrings,NOW())=#{day}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateMessageCenter" parameterType="com.caimei365.user.model.vo.MessageCenter">
|
|
|
+
|
|
|
+ update message_center
|
|
|
+ <set>
|
|
|
+<!-- <if test="id != null and id != 0">id = #{id},</if>-->
|
|
|
+<!-- <if test="shopID != null and shopID != ''">shopID = #{shopID},</if>-->
|
|
|
+<!-- <if test="clubID != null and clubID != ''">clubID = #{clubID},</if>-->
|
|
|
+ <if test="orderId != null and orderId != '' ">orderID = #{orderId},</if>
|
|
|
+ <if test="userType != null and userType != ''">userType = #{userType},</if>
|
|
|
+ <if test="messageType != null and messageType != ''">messageType = #{messageType},</if>
|
|
|
+ <if test="accountType != null and accountType != ''">accountType = #{accountType},</if>
|
|
|
+ <if test="orderMessageType != null and orderMessageType != ''">orderMessageType = #{orderMessageType},</if>
|
|
|
+ <if test="couponMessageType != null and couponMessageType != ''">couponMessageType = #{couponMessageType},</if>
|
|
|
+ <if test="couponFee != null and couponFee != ''">couponFee = #{couponFee},</if>
|
|
|
+ <if test="content != null and content != ''">content = #{content},</if>
|
|
|
+ <if test="time != null and time != ''">`time` = #{time},</if>
|
|
|
+ <if test="saved != null and saved != ''">saved = #{saved},</if>
|
|
|
+ <if test="shopMessType != null and shopMessType != ''">shopMessType = #{shopMessType},</if>
|
|
|
+ <if test="shopTieredType != null and sex != ''">shopTieredType = #{shopTieredType},</if>
|
|
|
+ <if test="shopTieredType != null and shopTieredType != ''">couponType = #{couponType},</if>
|
|
|
+ <if test="productId != null and productId != ''">productID = #{productId},</if>
|
|
|
+ </set>
|
|
|
+ <where>
|
|
|
+ <if test="userType == 1">
|
|
|
+ and shopID=#{shopId}
|
|
|
+ </if>
|
|
|
+ <if test="userType == 2">
|
|
|
+ and clubID=#{clubId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
|
|
|
+ <insert id="insertMessageCenter" parameterType="com.caimei365.user.model.vo.MessageCenter">
|
|
|
+
|
|
|
+ insert into message_center
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="shopId != null and shopId != ''">shopID,</if>
|
|
|
+ <if test="clubId != null and clubId != ''">clubID,</if>
|
|
|
+ <if test="orderId != null and orderId != '' ">orderID,</if>
|
|
|
+ <if test="userType != null and userType != ''">userType ,</if>
|
|
|
+ <if test="messageType != null and messageType != ''">messageType,</if>
|
|
|
+ <if test="accountType != null and accountType != ''">accountType,</if>
|
|
|
+ <if test="orderMessageType != null and orderMessageType != ''">orderMessageType,</if>
|
|
|
+ <if test="couponMessageType != null and couponMessageType != ''">couponMessageTyp,</if>
|
|
|
+ <if test="couponFee != null and couponFee != ''">couponFee,</if>
|
|
|
+ <if test="content != null and content != ''">content,</if>
|
|
|
+ <if test="time != null and time != ''">`time`,</if>
|
|
|
+ <if test="saved != null and saved != ''">saved ,</if>
|
|
|
+ <if test="shopMessType != null and shopMessType != ''">shopMessType,</if>
|
|
|
+ <if test="shopTieredType != null and shopTieredType != ''">shopTieredType,</if>
|
|
|
+ <if test="shopTieredType != null and shopTieredType != ''">couponType,</if>
|
|
|
+ <if test="productId != null and productId != ''">productID,</if>
|
|
|
+ </trim >
|
|
|
+ values
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="shopId != null and shopId != ''"> #{shopId},</if>
|
|
|
+ <if test="clubId != null and clubId != ''"> #{clubId},</if>
|
|
|
+ <if test="orderId != null and orderId != '' "> #{orderId},</if>
|
|
|
+ <if test="userType != null and userType != ''"> #{userType},</if>
|
|
|
+ <if test="messageType != null and messageType != ''"> #{messageType},</if>
|
|
|
+ <if test="accountType != null and accountType != ''"> #{accountType},</if>
|
|
|
+ <if test="orderMessageType != null and orderMessageType != ''"> #{orderMessageType},</if>
|
|
|
+ <if test="couponMessageType != null and couponMessageType != ''"> #{couponMessageType},</if>
|
|
|
+ <if test="couponFee != null and couponFee != ''"> #{couponFee},</if>
|
|
|
+ <if test="content != null and content != ''"> #{content},</if>
|
|
|
+ <if test="time != null and time != ''"> #{time},</if>
|
|
|
+ <if test="saved != null and saved != ''"> #{saved},</if>
|
|
|
+ <if test="shopMessType != null and shopMessType != ''"> #{shopMessType},</if>
|
|
|
+ <if test="shopTieredType != null and sex != ''"> #{shopTieredType},</if>
|
|
|
+ <if test="shopTieredType != null and shopTieredType != ''"> #{couponType},</if>
|
|
|
+ <if test="productId != null and productId != ''"> #{productId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
</mapper>
|