后台服务
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

94 lignes
3.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.WxCouponMallMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponMall">
  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="product_id" jdbcType="BIGINT" property="productId" />
  9. <result column="mall_tenant_id" jdbcType="VARCHAR" property="mallTenantId" />
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  12. <result column="status" jdbcType="INTEGER" property="status" />
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`tenant_id`,`parent_tenant_id`,`product_id`,`mall_tenant_id`,`create_date`,`update_date`,`status`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != tenantId and '' != tenantId">
  23. and `tenant_id` = #{tenantId}
  24. </if>
  25. <if test=" null != parentTenantId and '' != parentTenantId">
  26. and `parent_tenant_id` = #{parentTenantId}
  27. </if>
  28. <if test=" null != productId ">
  29. and `product_id` = #{productId}
  30. </if>
  31. <if test=" null != mallTenantId ">
  32. and `mall_tenant_id` = #{mallTenantId}
  33. </if>
  34. <if test=" null != createDate ">
  35. and `create_date` = #{createDate}
  36. </if>
  37. <if test=" null != updateDate ">
  38. and `update_date` = #{updateDate}
  39. </if>
  40. <if test=" null != status ">
  41. and `status` = #{status}
  42. </if>
  43. <if test=" null != ids ">
  44. and id in
  45. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  46. #{idItem}
  47. </foreach>
  48. </if>
  49. <if test=" null != productIds ">
  50. and product_id in
  51. <foreach collection="productIds" index="index" item="productIdItem" open="(" separator="," close=")">
  52. #{productIdItem}
  53. </foreach>
  54. </if>
  55. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  56. </sql>
  57. <select id="findList" parameterType="com.iformall.domain.po.WxCouponMall" resultMap="BaseResultMap">
  58. select
  59. <include refid="allColumns"/>
  60. from wx_coupon_mall
  61. <include refid="dynamicWhereConditions" />
  62. </select>
  63. <select id="findCouponIdList" parameterType="com.iformall.domain.po.WxCouponMall" resultType="Long">
  64. select product_id from wx_coupon_mall
  65. <include refid="dynamicWhereConditions" />
  66. </select>
  67. <update id = "updateStatus" parameterType="com.iformall.domain.po.WxCouponMall">
  68. update wx_coupon_mall set status = #{status} where `product_id` = #{productId}
  69. and `tenant_id` = #{tenantId} and `mall_tenant_id` = #{mallTenantId}
  70. </update>
  71. <update id = "delteAllByProductId" parameterType="com.iformall.domain.po.WxCouponMall">
  72. delete from wx_coupon_mall where `product_id` = #{productId} and `tenant_id` = #{tenantId}
  73. </update>
  74. </mapper>