123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?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.kmall.admin.dao.compared.TaxInfoDao">
- <resultMap type="com.kmall.admin.entity.compared.TaxInfoEntity" id="taxInfoMap">
- <result property="mtiId" column="mti_id"/>
- <result property="merchOrderSn" column="merch_order_sn"/>
- <result property="preTaxPrice" column="pre_tax_price"/>
- <result property="tax" column="tax"/>
- <result property="importTime" column="import_time"/>
- <result property="importer" column="importer"/>
- <result property="compared" column="compared"/>
- <result property="comparedTime" column="compared_time"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.compared.TaxInfoEntity">
- select
- `mti_id`,
- `merch_order_sn`,
- `pre_tax_price`,
- `tax`,
- `import_time`,
- `importer`,
- `compared`,
- `compared_time`
- from mall_tax_info
- where mti_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.compared.TaxInfoEntity">
- select
- `mti_id`,
- `merch_order_sn`,
- `pre_tax_price`,
- `tax`,
- `import_time`,
- `importer`,
- `compared`,
- `compared_time`
- from mall_tax_info
- WHERE 1=1
- <if test="compared != null and compared.trim() != ''">
- and compared = #{compared}
- </if>
- <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
- AND merch_order_sn LIKE concat('%',#{merchOrderSn},'%')
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_tax_info
- WHERE 1=1
- <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
- AND merch_order_sn LIKE concat('%',#{merchOrderSn},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.compared.TaxInfoEntity" useGeneratedKeys="true" keyProperty="mtiId">
- insert into mall_tax_info(
- `merch_order_sn`,
- `pre_tax_price`,
- `tax`,
- `import_time`,
- `importer`,
- `compared`,
- `compared_time`)
- values(
- #{merchOrderSn},
- #{preTaxPrice},
- #{tax},
- #{importTime},
- #{importer},
- #{compared},
- #{comparedTime})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.compared.TaxInfoEntity">
- update mall_tax_info
- <set>
- <if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
- <if test="preTaxPrice != null">`pre_tax_price` = #{preTaxPrice}, </if>
- <if test="tax != null">`tax` = #{tax}, </if>
- <if test="importTime != null">`import_time` = #{importTime}, </if>
- <if test="importer != null">`importer` = #{importer}, </if>
- <if test="compared != null">`compared` = #{compared}, </if>
- <if test="comparedTime != null">`compared_time` = #{comparedTime}</if>
- </set>
- where mti_id = #{mtiId}
- </update>
- <delete id="delete">
- delete from mall_tax_info where mti_id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_tax_info where mti_id in
- <foreach item="mtiId" collection="array" open="(" separator="," close=")">
- #{mtiId}
- </foreach>
- </delete>
- <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="mtiId">
- insert into mall_tax_info(
- `merch_order_sn`,
- `pre_tax_price`,
- `tax`,
- `import_time`,
- `importer`,
- `compared`,
- `compared_time`)
- values
- <foreach collection="list" index="index" item="item" separator=",">
- (
- #{item.merchOrderSn},
- #{item.preTaxPrice},
- #{item.tax},
- #{item.importTime},
- #{item.importer},
- #{item.compared},
- #{item.comparedTime}
- )
- </foreach>
- </insert>
- <update id="updateBatch" parameterType="java.util.List">
- <foreach collection="list" item="oderInfo" index="index" open="" close="" separator=";">
- update mall_tax_info
- <set>
- <if test="oderInfo.compared != null">`compared` = #{oderInfo.compared}, </if>
- <if test="oderInfo.comparedTime != null">`compared_time` = #{oderInfo.comparedTime}</if>
- </set>
- where mti_id = #{oderInfo.mtiId}
- </foreach>
- </update>
- </mapper>
|