后台服务
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

104 linhas
4.1 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.WxPressBatchItemMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPressBatchItem">
  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="press_batch_id" jdbcType="BIGINT" property="pressBatchId" />
  9. <result column="coupon_id" jdbcType="BIGINT" property="couponId"/>
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  12. <result column="press_batch_status" jdbcType="INTEGER" property="pressBatchStatus"/>
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`, `tenant_id`, `parent_tenant_id`, `press_batch_id`, `coupon_id`, `create_date`,`update_date`,`press_batch_status`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where `tenant_id` = #{tenantId}
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != parentTenantId and '' != parentTenantId">
  23. and `parent_tenant_id` = #{parentTenantId}
  24. </if>
  25. <if test=" null != pressBatchId">
  26. and `press_batch_id` = #{pressBatchId}
  27. </if>
  28. <if test=" null != couponId">
  29. and `coupon_id` = #{couponId}
  30. </if>
  31. <if test=" null != pressBatchStatus">
  32. and `press_batch_status` = #{pressBatchStatus}
  33. </if>
  34. <if test=" null != ids ">
  35. and `id` in
  36. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  37. #{idItem}
  38. </foreach>
  39. </if>
  40. </sql>
  41. <select id="findList" parameterType="com.iformall.domain.po.WxPressBatchItem" resultMap="BaseResultMap">
  42. select
  43. <include refid="allColumns"/>
  44. from wx_press_batch_item
  45. <include refid="dynamicWhereConditions"/>
  46. <if test=" null != sortColumns">order by ${sortColumns}</if>
  47. </select>
  48. <select id="getBatchIdList" parameterType="java.util.HashMap" resultType="Long">
  49. select distinct press_batch_id from wx_press_batch_item where `tenant_id` = #{tenantId}
  50. <if test=" null != pressBatchStatus">
  51. and `press_batch_status` = #{pressBatchStatus}
  52. </if>
  53. <if test=" null != couponIds ">
  54. and `coupon_id` in
  55. <foreach collection="couponIds" index="index" item="cIdItem" open="(" separator="," close=")">
  56. #{cIdItem}
  57. </foreach>
  58. </if>
  59. </select>
  60. <select id="getById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  61. select
  62. <include refid="allColumns"/>
  63. from wx_press_batch_item
  64. where `id` = #{id}
  65. and tenant_id=#{tenantId}
  66. </select>
  67. <update id="updateWxPressBatchStatus" parameterType="com.iformall.domain.po.WxPressBatchItem" >
  68. update wx_press_batch_item set press_batch_status = #{pressBatchStatus} where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId}
  69. </update>
  70. <delete id= "deleteItem" parameterType="com.iformall.domain.po.WxPressBatchItem" >
  71. delete from wx_press_batch_item where `id` = #{id} and tenant_id=#{tenantId}
  72. </delete>
  73. <delete id= "deleteAllItem" parameterType="com.iformall.domain.po.WxPressBatchItem" >
  74. delete from wx_press_batch_item where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId}
  75. </delete>
  76. <select id="getCouponIds" parameterType="java.util.HashMap" resultType="Long">
  77. select coupon_id from wx_press_batch_item where tenant_id=#{tenantId}
  78. <if test=" null != pressBatchId">
  79. and `press_batch_id` = #{pressBatchId}
  80. </if>
  81. <if test=" null != pressBatchStatus">
  82. and `press_batch_status` = #{pressBatchStatus}
  83. </if>
  84. </select>
  85. </mapper>