后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxBatchOrderMapper.xml 4.4 KiB

2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.iformall.mapper.WxBatchOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBatchOrder">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
  9. <result column="payment" jdbcType="INTEGER" property="payment"/>
  10. <result column="ext_param" jdbcType="VARCHAR" property="extParam"/>
  11. <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/>
  12. <result column="pay_version" jdbcType="INTEGER" property="payVersion"/>
  13. <result column="order_type" jdbcType="INTEGER" property="orderType"/>
  14. <result column="is_tt_poi_order" jdbcType="INTEGER" property="isTtPoiOrder"/>
  15. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  16. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`payment`,`ext_param`,`pay_vendor`,`pay_version`,`order_type`,`is_tt_poi_order`,`create_date`,`update_date`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != tenantId and '' != tenantId">
  27. and `tenant_id` = #{tenantId}
  28. </if>
  29. <if test=" null != parentTenantId and '' != parentTenantId">
  30. and `parent_tenant_id` = #{parentTenantId}
  31. </if>
  32. <if test=" null != cUserId ">
  33. and `c_user_id` = #{cUserId}
  34. </if>
  35. <if test=" null != payment ">
  36. and `payment` = #{payment}
  37. </if>
  38. <if test=" null != payVendor ">
  39. and `pay_vendor` = #{payVendor}
  40. </if>
  41. <if test=" null != payVersion ">
  42. and `pay_version` = #{payVersion}
  43. </if>
  44. <if test=" null != ids ">
  45. and id in
  46. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  47. #{idItem}
  48. </foreach>
  49. </if>
  50. <if test=" null != sortColumns">order by ${sortColumns}</if>
  51. </sql>
  52. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  53. select <include refid="allColumns"/> from wx_batch_order where id =#{id} and tenant_id=#{tenantId}
  54. </select>
  55. <select id="findList" parameterType="com.iformall.domain.po.WxBatchOrder" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from wx_batch_order
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. <select id="findCOrderList" parameterType="com.iformall.domain.po.WxBatchOrder" resultMap="BaseResultMap">
  62. select
  63. <include refid="allColumns"/>
  64. from wx_batch_order o
  65. where o.c_user_id = #{cUserId} and o.`tenant_id` = #{tenantId}
  66. <if test=" null != parentTenantId and '' != parentTenantId">
  67. and o.`parent_tenant_id` = #{parentTenantId}
  68. </if>
  69. <if test=" null != id ">
  70. and o.`id` = #{id}
  71. </if>
  72. <if test=" null != payVendor ">
  73. and o.pay_vendor = #{payVendor}
  74. </if>
  75. <if test=" null != payVersion ">
  76. and o.pay_version = #{payVersion}
  77. </if>
  78. <if test=" null != ids ">
  79. and o.id in
  80. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  81. #{idItem}
  82. </foreach>
  83. </if>
  84. order by o.create_date desc
  85. </select>
  86. <select id="countList" parameterType="com.iformall.domain.po.WxBatchOrder" resultType="java.lang.Integer">
  87. select count(1) from wx_batch_order
  88. <include refid="dynamicWhereConditions"/>
  89. </select>
  90. <update id="updateCUserId" parameterType="com.iformall.domain.po.WxBatchOrder">
  91. update wx_batch_order set `c_user_id` = #{cUserId} where id =#{id} and tenant_id=#{tenantId}
  92. </update>
  93. <update id="updatePayMent" parameterType="java.util.HashMap">
  94. update wx_batch_order set `payment` = #{payment} where id =#{id} and tenant_id=#{tenantId}
  95. </update>
  96. </mapper>