|
@@ -0,0 +1,149 @@
|
|
|
|
|
+<?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.fs.hisStore.mapper.FsStorePreparedPriceChangeMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="FsStorePreparedPriceChange" id="FsStorePreparedPriceChangeResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="cartIds" column="cart_ids" />
|
|
|
|
|
+ <result property="money" column="money" />
|
|
|
|
|
+ <result property="payAmount" column="pay_amount" />
|
|
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
|
|
+ <result property="createOrderKey" column="create_order_key" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
|
+ <result property="auditStatus" column="audit_status" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectFsStorePreparedPriceChangeVo">
|
|
|
|
|
+ select id, cart_ids, money, pay_amount, company_user_id, create_order_key, create_time, update_time, create_by, update_by,audit_status from fs_store_prepared_price_change
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangeList" parameterType="FsStorePreparedPriceChange" resultMap="FsStorePreparedPriceChangeResult">
|
|
|
|
|
+ <include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="money != null "> and money = #{money}</if>
|
|
|
|
|
+ <if test="payAmount != null "> and pay_amount = #{payAmount}</if>
|
|
|
|
|
+ <if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
|
|
|
|
|
+ <if test="cartIds != null and cartIds != ''"> and cart_ids = #{cartIds}</if>
|
|
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
|
|
+ <if test="createOrderKey != null and createOrderKey != ''"> and create_order_key = #{createOrderKey}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by id desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangeById" parameterType="String" resultMap="FsStorePreparedPriceChangeResult">
|
|
|
|
|
+ <include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into fs_store_prepared_price_change
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="cartIds != null and cartIds != ''">cart_ids,</if>
|
|
|
|
|
+ <if test="money != null">money,</if>
|
|
|
|
|
+ <if test="payAmount != null">pay_amount,</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
|
|
+ <if test="createOrderKey != null and createOrderKey != ''">create_order_key,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
|
+ <if test="auditStatus != null">audit_status,</if>
|
|
|
|
|
+ <if test="payType != null">pay_type,</if>
|
|
|
|
|
+ <if test="auditRemark != null">audit_remark ,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="cartIds != null and cartIds != ''">#{cartIds},</if>
|
|
|
|
|
+ <if test="money != null">#{money},</if>
|
|
|
|
|
+ <if test="payAmount != null">#{payAmount},</if>
|
|
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
|
|
+ <if test="createOrderKey != null and createOrderKey != ''">#{createOrderKey},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
+ <if test="auditStatus != null">#{auditStatus},</if>
|
|
|
|
|
+ <if test="payType != null">#{payType},</if>
|
|
|
|
|
+ <if test="auditRemark != null">#{auditRemark} ,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange">
|
|
|
|
|
+ update fs_store_prepared_price_change
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="cartIds != null and cartIds != ''">cart_ids = #{cartIds},</if>
|
|
|
|
|
+ <if test="money != null">money = #{money},</if>
|
|
|
|
|
+ <if test="payAmount != null">pay_amount = #{payAmount},</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
|
|
+ <if test="createOrderKey != null and createOrderKey != ''">create_order_key = #{createOrderKey},</if>
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
+ <if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
|
|
|
+ <if test="payType != null">pay_type = #{payType},</if>
|
|
|
|
|
+ <if test="auditRemark != null">audit_remark = #{auditRemark} ,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsStorePreparedPriceChangeById" parameterType="String">
|
|
|
|
|
+ delete from fs_store_prepared_price_change where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsStorePreparedPriceChangeByIds" parameterType="String">
|
|
|
|
|
+ delete from fs_store_prepared_price_change where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="batchAudit">
|
|
|
|
|
+ update fs_store_prepared_price_change set audit_status = #{auditStatus},audit_remark = #{auditRemark} where id in
|
|
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangePageList" resultType="com.fs.hisStore.domain.FsStorePreparedPriceChange">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ pc.*,
|
|
|
|
|
+ GROUP_CONCAT(
|
|
|
|
|
+ ps.product_name
|
|
|
|
|
+ SEPARATOR '|'
|
|
|
|
|
+ ) AS matched_products,
|
|
|
|
|
+ cu.nick_name
|
|
|
|
|
+ FROM
|
|
|
|
|
+ fs_store_prepared_price_change pc
|
|
|
|
|
+ LEFT JOIN fs_store_cart_scrm cs
|
|
|
|
|
+ ON FIND_IN_SET(cs.id, REPLACE(pc.cart_ids, ' ', ''))
|
|
|
|
|
+ LEFT JOIN fs_store_product_scrm ps
|
|
|
|
|
+ ON cs.product_id = ps.product_id
|
|
|
|
|
+ LEFT JOIN fs_store_scrm ss
|
|
|
|
|
+ ON ss.store_id = ps.store_id
|
|
|
|
|
+ LEFT JOIN company_user cu ON pc.company_user_id = cu.user_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ cs.is_del = 0
|
|
|
|
|
+ <if test="matchedProducts != null and matchedProducts != ''">
|
|
|
|
|
+ AND pc.id IN (
|
|
|
|
|
+ SELECT DISTINCT pc_sub.id
|
|
|
|
|
+ FROM fs_store_prepared_price_change pc_sub
|
|
|
|
|
+ LEFT JOIN fs_store_cart_scrm cs_sub
|
|
|
|
|
+ ON FIND_IN_SET(cs_sub.id, REPLACE(pc_sub.cart_ids, ' ', ''))
|
|
|
|
|
+ LEFT JOIN fs_store_product_scrm ps_sub
|
|
|
|
|
+ ON cs_sub.product_id = ps_sub.product_id
|
|
|
|
|
+ WHERE ps_sub.product_name LIKE CONCAT('%',#{matchedProducts},'%')
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="nickName != null and nickName != ''">
|
|
|
|
|
+ AND cu.nick_name LIKE CONCAT('%',#{nickName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="auditStatus != null "> AND audit_status = #{auditStatus}</if>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ pc.id
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|