|
@@ -1,46 +1,62 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
<!DOCTYPE mapper
|
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.fs.hisStore.mapper.FsStorePreparedPriceChangeMapper">
|
|
<mapper namespace="com.fs.hisStore.mapper.FsStorePreparedPriceChangeMapper">
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<resultMap type="FsStorePreparedPriceChange" id="FsStorePreparedPriceChangeResult">
|
|
<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" />
|
|
|
|
|
|
|
+ <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"/>
|
|
|
|
|
+ <result property="totalAmount" column="total_amount"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectFsStorePreparedPriceChangeVo">
|
|
<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
|
|
|
|
|
|
|
+ select id,
|
|
|
|
|
+ cart_ids,
|
|
|
|
|
+ money,
|
|
|
|
|
+ pay_amount,
|
|
|
|
|
+ company_user_id,
|
|
|
|
|
+ create_order_key,
|
|
|
|
|
+ create_time,
|
|
|
|
|
+ update_time,
|
|
|
|
|
+ create_by,
|
|
|
|
|
+ update_by,
|
|
|
|
|
+ audit_status,
|
|
|
|
|
+ total_amount
|
|
|
|
|
+ from fs_store_prepared_price_change
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
- <select id="selectFsStorePreparedPriceChangeList" parameterType="FsStorePreparedPriceChange" resultMap="FsStorePreparedPriceChangeResult">
|
|
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangeList" parameterType="FsStorePreparedPriceChange"
|
|
|
|
|
+ resultMap="FsStorePreparedPriceChangeResult">
|
|
|
<include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
<include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
|
<where>
|
|
<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>
|
|
|
|
|
|
|
+ <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>
|
|
</where>
|
|
|
order by id desc
|
|
order by id desc
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
- <select id="selectFsStorePreparedPriceChangeById" parameterType="String" resultMap="FsStorePreparedPriceChangeResult">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangeById" parameterType="String"
|
|
|
|
|
+ resultMap="FsStorePreparedPriceChangeResult">
|
|
|
<include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
<include refid="selectFsStorePreparedPriceChangeVo"/>
|
|
|
where id = #{id}
|
|
where id = #{id}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
- <insert id="insertFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange" useGeneratedKeys="true"
|
|
|
|
|
+ keyProperty="id">
|
|
|
insert into fs_store_prepared_price_change
|
|
insert into fs_store_prepared_price_change
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="cartIds != null and cartIds != ''">cart_ids,</if>
|
|
<if test="cartIds != null and cartIds != ''">cart_ids,</if>
|
|
@@ -55,7 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditStatus != null">audit_status,</if>
|
|
<if test="auditStatus != null">audit_status,</if>
|
|
|
<if test="payType != null">pay_type,</if>
|
|
<if test="payType != null">pay_type,</if>
|
|
|
<if test="auditRemark != null">audit_remark ,</if>
|
|
<if test="auditRemark != null">audit_remark ,</if>
|
|
|
- </trim>
|
|
|
|
|
|
|
+ <if test="totalAmount != null">total_amount ,</if>
|
|
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="cartIds != null and cartIds != ''">#{cartIds},</if>
|
|
<if test="cartIds != null and cartIds != ''">#{cartIds},</if>
|
|
|
<if test="money != null">#{money},</if>
|
|
<if test="money != null">#{money},</if>
|
|
@@ -69,7 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditStatus != null">#{auditStatus},</if>
|
|
<if test="auditStatus != null">#{auditStatus},</if>
|
|
|
<if test="payType != null">#{payType},</if>
|
|
<if test="payType != null">#{payType},</if>
|
|
|
<if test="auditRemark != null">#{auditRemark} ,</if>
|
|
<if test="auditRemark != null">#{auditRemark} ,</if>
|
|
|
- </trim>
|
|
|
|
|
|
|
+ <if test="totalAmount != null">#{totalAmount} ,</if>
|
|
|
|
|
+ </trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange">
|
|
<update id="updateFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange">
|
|
@@ -87,63 +105,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
|
<if test="payType != null">pay_type = #{payType},</if>
|
|
<if test="payType != null">pay_type = #{payType},</if>
|
|
|
<if test="auditRemark != null">audit_remark = #{auditRemark} ,</if>
|
|
<if test="auditRemark != null">audit_remark = #{auditRemark} ,</if>
|
|
|
|
|
+ <if test="totalAmount != null">total_amount = #{totalAmount} ,</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
where id = #{id}
|
|
where id = #{id}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteFsStorePreparedPriceChangeById" parameterType="String">
|
|
<delete id="deleteFsStorePreparedPriceChangeById" parameterType="String">
|
|
|
- delete from fs_store_prepared_price_change where id = #{id}
|
|
|
|
|
|
|
+ delete
|
|
|
|
|
+ from fs_store_prepared_price_change
|
|
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteFsStorePreparedPriceChangeByIds" parameterType="String">
|
|
<delete id="deleteFsStorePreparedPriceChangeByIds" parameterType="String">
|
|
|
- delete from fs_store_prepared_price_change where id in
|
|
|
|
|
|
|
+ delete from fs_store_prepared_price_change where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<update id="batchAudit">
|
|
<update id="batchAudit">
|
|
|
- update fs_store_prepared_price_change set audit_status = #{auditStatus},audit_remark = #{auditRemark} where id in
|
|
|
|
|
|
|
+ update fs_store_prepared_price_change set audit_status = #{auditStatus},audit_remark = #{auditRemark} where id
|
|
|
|
|
+ in
|
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
- <select id="selectFsStorePreparedPriceChangePageList" resultType="com.fs.hisStore.domain.FsStorePreparedPriceChange">
|
|
|
|
|
|
|
+ <select id="selectFsStorePreparedPriceChangePageList"
|
|
|
|
|
+ resultType="com.fs.hisStore.domain.FsStorePreparedPriceChange">
|
|
|
SELECT
|
|
SELECT
|
|
|
- pc.*,
|
|
|
|
|
- GROUP_CONCAT(
|
|
|
|
|
- ps.product_name
|
|
|
|
|
- SEPARATOR '|'
|
|
|
|
|
- ) AS matched_products,
|
|
|
|
|
- cu.nick_name
|
|
|
|
|
|
|
+ pc.*,
|
|
|
|
|
+ GROUP_CONCAT(
|
|
|
|
|
+ ps.product_name
|
|
|
|
|
+ SEPARATOR '|'
|
|
|
|
|
+ ) AS matched_products,
|
|
|
|
|
+ cu.nick_name
|
|
|
FROM
|
|
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
|
|
|
|
|
|
|
+ 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
|
|
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>
|
|
|
|
|
|
|
+ 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>
|
|
|
|
|
+ <if test="companyUserId != null ">AND company_user_id = #{companyUserId}</if>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
- pc.id
|
|
|
|
|
|
|
+ pc.id
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ pc.id DESC
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|