123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <?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.emato.biz.mapper.mall.MallMngChangeMapper">
- <resultMap type="MallMngChange" id="MallMngChangeResult">
- <result property="id" column="id" />
- <result property="changeNum" column="change_num" />
- <result property="originalNum" column="original_num" />
- <result property="validNum" column="valid_num" />
- <result property="thirdPartyMerchCode" column="third_party_merch_code" />
- <result property="merchSn" column="merch_sn" />
- <result property="isValid" column="is_valid" />
- <result property="createrSn" column="creater_sn" />
- <result property="createTime" column="create_time" />
- <result property="moderSn" column="moder_sn" />
- <result property="modTime" column="mod_time" />
- <result property="tstm" column="tstm" />
- <result property="goodsId" column="goods_id" />
- <result property="changeType" column="change_type" />
- <result property="changeReason" column="change_reason" />
- </resultMap>
- <sql id="selectMallMngChangeVo">
- select id, change_num, original_num, valid_num, third_party_merch_code, merch_sn, is_valid, creater_sn, create_time, moder_sn, mod_time, tstm, goods_id, change_type, change_reason from mall_mng_change
- </sql>
- <select id="selectMallMngChangeList" parameterType="MallMngChange" resultMap="MallMngChangeResult">
- <include refid="selectMallMngChangeVo"/>
- <where>
- <if test="thirdPartyMerchCode != null and thirdPartyMerchCode != ''"> and third_party_merch_code = #{thirdPartyMerchCode}</if>
- <if test="merchSn != null and merchSn != ''"> and merch_sn = #{merchSn}</if>
- <if test="isValid != null and isValid != ''"> and is_valid = #{isValid}</if>
- <if test="goodsId != null "> and goods_id = #{goodsId}</if>
- <if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
- <if test="changeReason != null and changeReason != ''"> and change_reason = #{changeReason}</if>
- </where>
- </select>
- <select id="selectMallMngChangeById" parameterType="Long" resultMap="MallMngChangeResult">
- <include refid="selectMallMngChangeVo"/>
- where id = #{id}
- </select>
- <insert id="insertMallMngChange" parameterType="MallMngChange">
- insert into mall_mng_change
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="changeNum != null">change_num,</if>
- <if test="originalNum != null">original_num,</if>
- <if test="validNum != null">valid_num,</if>
- <if test="thirdPartyMerchCode != null">third_party_merch_code,</if>
- <if test="merchSn != null">merch_sn,</if>
- <if test="isValid != null">is_valid,</if>
- <if test="createrSn != null">creater_sn,</if>
- <if test="createTime != null">create_time,</if>
- <if test="moderSn != null">moder_sn,</if>
- <if test="modTime != null">mod_time,</if>
- <if test="tstm != null">tstm,</if>
- <if test="goodsId != null">goods_id,</if>
- <if test="changeType != null">change_type,</if>
- <if test="changeReason != null">change_reason,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="changeNum != null">#{changeNum},</if>
- <if test="originalNum != null">#{originalNum},</if>
- <if test="validNum != null">#{validNum},</if>
- <if test="thirdPartyMerchCode != null">#{thirdPartyMerchCode},</if>
- <if test="merchSn != null">#{merchSn},</if>
- <if test="isValid != null">#{isValid},</if>
- <if test="createrSn != null">#{createrSn},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="moderSn != null">#{moderSn},</if>
- <if test="modTime != null">#{modTime},</if>
- <if test="tstm != null">#{tstm},</if>
- <if test="goodsId != null">#{goodsId},</if>
- <if test="changeType != null">#{changeType},</if>
- <if test="changeReason != null">#{changeReason},</if>
- </trim>
- </insert>
- <update id="updateMallMngChange" parameterType="MallMngChange">
- update mall_mng_change
- <trim prefix="SET" suffixOverrides=",">
- <if test="changeNum != null">change_num = #{changeNum},</if>
- <if test="originalNum != null">original_num = #{originalNum},</if>
- <if test="validNum != null">valid_num = #{validNum},</if>
- <if test="thirdPartyMerchCode != null">third_party_merch_code = #{thirdPartyMerchCode},</if>
- <if test="merchSn != null">merch_sn = #{merchSn},</if>
- <if test="isValid != null">is_valid = #{isValid},</if>
- <if test="createrSn != null">creater_sn = #{createrSn},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="moderSn != null">moder_sn = #{moderSn},</if>
- <if test="modTime != null">mod_time = #{modTime},</if>
- <if test="tstm != null">tstm = #{tstm},</if>
- <if test="goodsId != null">goods_id = #{goodsId},</if>
- <if test="changeType != null">change_type = #{changeType},</if>
- <if test="changeReason != null">change_reason = #{changeReason},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteMallMngChangeById" parameterType="Long">
- delete from mall_mng_change where id = #{id}
- </delete>
- <delete id="deleteMallMngChangeByIds" parameterType="String">
- delete from mall_mng_change where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <!-- 接收kmall数据-->
- <insert id="pushSalesDetaiDate" parameterType="NewSystemFormatEntiy">
- insert into mall_sales_detail_data
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="merchSn != null">merch_sn,</if>
- <if test="merchSnName != null">merch_sn_name,</if>
- <if test="thirdMerchSn != null">third_merch_sn,</if>
- <if test="thirdMerchSnName != null">third_merch_sn_name,</if>
- <if test="receiptNo != null">receipt_no,</if>
- <if test="storeName != null">store_name,</if>
- <if test="storeNameSn != null">store_name_sn,</if>
- <if test="cashRegisterNo != null">cash_register_no,</if>
- <if test="timeStampDetails != null">time_stamp,</if>
- <if test="staffID != null">staff_id,</if>
- <if test="staffName != null">staff_name,</if>
- <if test="payFlag != null">pay_flag,</if>
- <if test="orderStatus != null">order_status,</if>
- <if test="orderSnWx != null">order_sn_wx,</if>
- <if test="orderSnAli != null">order_sn_ali,</if>
- <if test="hsCode != null">hs_code,</if>
- <if test="hsCodeName != null">hs_code_name,</if>
- <if test="ematouCode != null">ematou_code,</if>
- <if test="plu != null">plu,</if>
- <if test="mychemID != null">mychem_id,</if>
- <if test="productNameEN != null">product_name_en,</if>
- <if test="productNameCN != null">product_name_cn,</if>
- <if test="barcode != null">barcode,</if>
- <if test="packSize != null">pack_size,</if>
- <if test="productSpecification != null">product_spec,</if>
- <if test="brand != null">brand,</if>
- <if test="edlp != null">edlp,</if>
- <if test="currentPrice != null">current_price,</if>
- <if test="costPrice != null">cost_price,</if>
- <if test="taxRate != null">tax_rate,</if>
- <if test="taxPrice != null">tax_price,</if>
- <if test="productCategory != null">product_category,</if>
- <if test="supplierName != null">supplier_name,</if>
- <if test="transactionType != null">transaction_type,</if>
- <if test="saleReturnType != null">sale_return_type,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="merchSn != null">#{merchSn},</if>
- <if test="merchSnName != null">#{merchSnName},</if>
- <if test="thirdMerchSn != null">#{thirdMerchSn},</if>
- <if test="thirdMerchSnName != null">#{thirdMerchSnName},</if>
- <if test="receiptNo != null">#{receiptNo},</if>
- <if test="storeName != null">#{storeName},</if>
- <if test="storeNameSn != null">#{storeNameSn},</if>
- <if test="cashRegisterNo != null">#{cashRegisterNo},</if>
- <if test="timeStampDetails != null">#{timeStampDetails},</if>
- <if test="staffID != null">#{staffID},</if>
- <if test="staffName != null">#{staffName},</if>
- <if test="payFlag != null">#{payFlag},</if>
- <if test="orderStatus != null">#{orderStatus},</if>
- <if test="orderSnWx != null">#{orderSnWx},</if>
- <if test="orderSnAli != null">#{orderSnAli},</if>
- <if test="hsCode != null">#{hsCode},</if>
- <if test="hsCodeName != null">#{hsCodeName},</if>
- <if test="ematouCode != null">#{ematouCode},</if>
- <if test="plu != null">#{plu},</if>
- <if test="mychemID != null">#{mychemID},</if>
- <if test="productNameEN != null">#{productNameEN},</if>
- <if test="productNameCN != null">#{productNameCN},</if>
- <if test="barcode != null">#{barcode},</if>
- <if test="packSize != null">#{packSize},</if>
- <if test="productSpecification != null">#{productSpecification},</if>
- <if test="brand != null">#{brand},</if>
- <if test="edlp != null">#{edlp},</if>
- <if test="currentPrice != null">#{currentPrice},</if>
- <if test="costPrice != null">#{costPrice},</if>
- <if test="taxRate != null">#{taxRate},</if>
- <if test="taxPrice != null">#{taxPrice},</if>
- <if test="productCategory != null">#{productCategory},</if>
- <if test="supplierName != null">#{supplierName},</if>
- <if test="transactionType != null">#{transactionType},</if>
- <if test="saleReturnType != null">#{saleReturnType},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <!-- 外部接口查询订单信息-->
- <select id="getSalesDetaiData" parameterType="java.util.Map" resultType="com.emato.biz.domain.mall.PushSystemOdOderVo">
- SELECT
- merch_sn_name as merchSnName,
- third_merch_sn_name as thirdMerchSnName,
- receipt_no as receiptNo,
- store_name as storeName,
- store_name_sn as storeNameSn,
- cash_register_no as cashRegisterNo,
- time_stamp as timeStampDetails,
- staff_id as staffID,
- staff_name as staffName,
- pay_flag as payFlag,
- order_status as orderStatus,
- order_sn_wx as orderSnWx,
- order_sn_ali as orderSnAli,
- hs_code as hsCode,
- hs_code_name as hsCodeName,
- ematou_code as ematouCode,
- plu as plu,
- mychem_id as mychemID,
- product_name_en as productNameEN,
- product_name_cn as productNameCN,
- barcode as barcode,
- pack_size as packSize,
- product_spec as productSpecification,
- brand as brand,
- edlp as edlp,
- current_price as currentPrice,
- cost_price as costPrice,
- tax_rate as taxRate,
- tax_price as taxPrice,
- product_category as productCategory,
- supplier_name as supplierName,
- transaction_type as transactionType,
- sale_return_type as saleReturnType,
- remark
- FROM
- mall_sales_detail_data
- WHERE
- <if test="starTime != null and starTime != ''">
- time_stamp > STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''">
- AND time_stamp <= STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')
- </if>
- <if test="orderStatus !=null and orderStatus !=''">
- AND order_status = #{orderStatus}
- </if>
- <if test="orderNo !=null and orderNo !=''">
- AND receipt_no = #{orderNo}
- </if>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="getTotalRecord" parameterType="java.util.Map" resultType="java.lang.Integer">
- SELECT
- count(*)
- FROM
- mall_sales_detail_data
- WHERE
- <if test="starTime != null and starTime != ''">
- time_stamp > STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''">
- AND time_stamp <= STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')
- </if>
- </select>
- <!-- 记录外部调用接口入参-->
- <insert id="pullQueryData" parameterType="java.lang.String">
- insert into mall_sales_detail_log(
- <if test="msg != null and msg != '' ">msg,</if>
- <if test="tranDirection != null and tranDirection != '' ">tran_direction,</if>
- msg_date
- )values(
- <if test="msg != null and msg != ''">#{msg},</if>
- <if test="tranDirection != null and tranDirection != ''">#{tranDirection},</if>
- sysdate()
- )
- </insert>
- </mapper>
|