Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

103 строки
4.0 KiB

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