TaxInfoDao.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.kmall.admin.dao.compared.TaxInfoDao">
  4. <resultMap type="com.kmall.admin.entity.compared.TaxInfoEntity" id="taxInfoMap">
  5. <result property="mtiId" column="mti_id"/>
  6. <result property="merchOrderSn" column="merch_order_sn"/>
  7. <result property="preTaxPrice" column="pre_tax_price"/>
  8. <result property="tax" column="tax"/>
  9. <result property="importTime" column="import_time"/>
  10. <result property="importer" column="importer"/>
  11. <result property="compared" column="compared"/>
  12. <result property="comparedTime" column="compared_time"/>
  13. </resultMap>
  14. <select id="queryObject" resultType="com.kmall.admin.entity.compared.TaxInfoEntity">
  15. select
  16. `mti_id`,
  17. `merch_order_sn`,
  18. `pre_tax_price`,
  19. `tax`,
  20. `import_time`,
  21. `importer`,
  22. `compared`,
  23. `compared_time`
  24. from mall_tax_info
  25. where mti_id = #{id}
  26. </select>
  27. <select id="queryList" resultType="com.kmall.admin.entity.compared.TaxInfoEntity">
  28. select
  29. `mti_id`,
  30. `merch_order_sn`,
  31. `pre_tax_price`,
  32. `tax`,
  33. `import_time`,
  34. `importer`,
  35. `compared`,
  36. `compared_time`
  37. from mall_tax_info
  38. WHERE 1=1
  39. <if test="compared != null and compared.trim() != ''">
  40. and compared = #{compared}
  41. </if>
  42. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  43. AND merch_order_sn LIKE concat('%',#{merchOrderSn},'%')
  44. </if>
  45. </select>
  46. <select id="queryTotal" resultType="int">
  47. select count(*) from mall_tax_info
  48. WHERE 1=1
  49. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  50. AND merch_order_sn LIKE concat('%',#{merchOrderSn},'%')
  51. </if>
  52. </select>
  53. <insert id="save" parameterType="com.kmall.admin.entity.compared.TaxInfoEntity" useGeneratedKeys="true" keyProperty="mtiId">
  54. insert into mall_tax_info(
  55. `merch_order_sn`,
  56. `pre_tax_price`,
  57. `tax`,
  58. `import_time`,
  59. `importer`,
  60. `compared`,
  61. `compared_time`)
  62. values(
  63. #{merchOrderSn},
  64. #{preTaxPrice},
  65. #{tax},
  66. #{importTime},
  67. #{importer},
  68. #{compared},
  69. #{comparedTime})
  70. </insert>
  71. <update id="update" parameterType="com.kmall.admin.entity.compared.TaxInfoEntity">
  72. update mall_tax_info
  73. <set>
  74. <if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
  75. <if test="preTaxPrice != null">`pre_tax_price` = #{preTaxPrice}, </if>
  76. <if test="tax != null">`tax` = #{tax}, </if>
  77. <if test="importTime != null">`import_time` = #{importTime}, </if>
  78. <if test="importer != null">`importer` = #{importer}, </if>
  79. <if test="compared != null">`compared` = #{compared}, </if>
  80. <if test="comparedTime != null">`compared_time` = #{comparedTime}</if>
  81. </set>
  82. where mti_id = #{mtiId}
  83. </update>
  84. <delete id="delete">
  85. delete from mall_tax_info where mti_id = #{value}
  86. </delete>
  87. <delete id="deleteBatch">
  88. delete from mall_tax_info where mti_id in
  89. <foreach item="mtiId" collection="array" open="(" separator="," close=")">
  90. #{mtiId}
  91. </foreach>
  92. </delete>
  93. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="mtiId">
  94. insert into mall_tax_info(
  95. `merch_order_sn`,
  96. `pre_tax_price`,
  97. `tax`,
  98. `import_time`,
  99. `importer`,
  100. `compared`,
  101. `compared_time`)
  102. values
  103. <foreach collection="list" index="index" item="item" separator=",">
  104. (
  105. #{item.merchOrderSn},
  106. #{item.preTaxPrice},
  107. #{item.tax},
  108. #{item.importTime},
  109. #{item.importer},
  110. #{item.compared},
  111. #{item.comparedTime}
  112. )
  113. </foreach>
  114. </insert>
  115. <update id="updateBatch" parameterType="java.util.List">
  116. <foreach collection="list" item="oderInfo" index="index" open="" close="" separator=";">
  117. update mall_tax_info
  118. <set>
  119. <if test="oderInfo.compared != null">`compared` = #{oderInfo.compared}, </if>
  120. <if test="oderInfo.comparedTime != null">`compared_time` = #{oderInfo.comparedTime}</if>
  121. </set>
  122. where mti_id = #{oderInfo.mtiId}
  123. </foreach>
  124. </update>
  125. </mapper>