1
0

TaxComparedErrorDao.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.TaxComparedErrorDao">
  4. <resultMap type="com.kmall.admin.entity.compared.TaxComparedErrorEntity" id="taxComparedErrorMap">
  5. <result property="mtceId" column="mtce_id"/>
  6. <result property="merchOrderSn" column="merch_order_sn"/>
  7. <result property="kmallTax" column="kmall_tax"/>
  8. <result property="omsTax" column="oms_tax"/>
  9. <result property="createTime" column="create_time"/>
  10. </resultMap>
  11. <select id="queryObject" resultType="com.kmall.admin.entity.compared.TaxComparedErrorEntity">
  12. select
  13. `mtce_id`,
  14. `merch_order_sn`,
  15. `kmall_tax`,
  16. `oms_tax`,
  17. `create_time`
  18. from mall_tax_compared_error
  19. where mtce_id = #{id}
  20. </select>
  21. <select id="queryList" resultType="com.kmall.admin.entity.compared.TaxComparedErrorEntity">
  22. select
  23. `mtce_id`,
  24. `merch_order_sn`,
  25. `kmall_tax`,
  26. `oms_tax`,
  27. `create_time`
  28. from mall_tax_compared_error
  29. WHERE 1=1
  30. <if test="createTime != null and createTime.trim() != ''">
  31. AND DATE_FORMAT(create_time,'%Y-%m-%d') = #{createTime}
  32. </if>
  33. order by create_time desc
  34. <if test="offset != null and limit != null">
  35. limit #{offset}, #{limit}
  36. </if>
  37. </select>
  38. <select id="queryTotal" resultType="int">
  39. select count(*) from mall_tax_compared_error
  40. WHERE 1=1
  41. <if test="name != null and name.trim() != ''">
  42. AND name LIKE concat('%',#{name},'%')
  43. </if>
  44. <if test="createTime != null and createTime.trim() != ''">
  45. AND DATE_FORMAT(create_time,'%Y-%m-%d') = #{createTime}
  46. </if>
  47. </select>
  48. <insert id="save" parameterType="com.kmall.admin.entity.compared.TaxComparedErrorEntity" useGeneratedKeys="true" keyProperty="mtceId">
  49. insert into mall_tax_compared_error(
  50. `merch_order_sn`,
  51. `kmall_tax`,
  52. `oms_tax`,
  53. `create_time`)
  54. values(
  55. #{merchOrderSn},
  56. #{kmallTax},
  57. #{omsTax},
  58. #{createTime})
  59. </insert>
  60. <update id="update" parameterType="com.kmall.admin.entity.compared.TaxComparedErrorEntity">
  61. update mall_tax_compared_error
  62. <set>
  63. <if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
  64. <if test="kmallTax != null">`kmall_tax` = #{kmallTax}, </if>
  65. <if test="omsTax != null">`oms_tax` = #{omsTax}, </if>
  66. <if test="createTime != null">`create_time` = #{createTime}</if>
  67. </set>
  68. where mtce_id = #{mtceId}
  69. </update>
  70. <delete id="delete">
  71. delete from mall_tax_compared_error where mtce_id = #{value}
  72. </delete>
  73. <delete id="deleteBatch">
  74. delete from mall_tax_compared_error where mtce_id in
  75. <foreach item="mtceId" collection="array" open="(" separator="," close=")">
  76. #{mtceId}
  77. </foreach>
  78. </delete>
  79. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="mtceId">
  80. insert into mall_tax_compared_error(
  81. `merch_order_sn`,
  82. `kmall_tax`,
  83. `oms_tax`,
  84. `create_time`)
  85. values
  86. <foreach collection="list" index="index" item="item" separator=",">
  87. (
  88. #{item.merchOrderSn},
  89. #{item.kmallTax},
  90. #{item.omsTax},
  91. #{item.createTime}
  92. )
  93. </foreach>
  94. </insert>
  95. </mapper>