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

127 строки
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.WxCouponMerchantMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponMerchant">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="product_id" jdbcType="BIGINT" property="productId" />
  7. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  8. <result column="parameter" jdbcType="VARCHAR" property="parameter" />
  9. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  10. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  11. <result column="status" jdbcType="INTEGER" property="status" />
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`,`product_id`,`merchant_id`,`parameter`,`create_date`,`update_date`,`status`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where 1 = 1
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != productId ">
  22. and `product_id` = #{productId}
  23. </if>
  24. <if test=" null != merchantId ">
  25. and `merchant_id` = #{merchantId}
  26. </if>
  27. <if test=" null != createDate ">
  28. and `create_date` = #{createDate}
  29. </if>
  30. <if test=" null != updateDate ">
  31. and `update_date` = #{updateDate}
  32. </if>
  33. <if test=" null != status ">
  34. and `status` = #{status}
  35. </if>
  36. <if test=" null != ids ">
  37. and id in
  38. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  39. #{idItem}
  40. </foreach>
  41. </if>
  42. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  43. </sql>
  44. <select id="findList" parameterType="com.iformall.domain.po.WxCouponMerchant" resultMap="BaseResultMap">
  45. select <include refid="allColumns" /> from wx_coupon_merchant
  46. <include refid="dynamicWhereConditions" />
  47. </select>
  48. <sql id="allMerchantVoColumns">
  49. m.id,m.img_url,m.name,m.link_phone,m.status,m.business_id,m.sub_business_id,
  50. cm.parameter
  51. </sql>
  52. <resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
  53. <id column="id" jdbcType="BIGINT" property="id"/>
  54. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
  55. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  56. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  57. <result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
  58. <result column="business_id" jdbcType="INTEGER" property="businessId"/>
  59. <result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/>
  60. <result column="parameter" jdbcType="VARCHAR" property="parameter"/>
  61. <collection column="{merchantId=id}" property="shopVoList"
  62. ofType="com.iformall.domain.vo.WxShopVo"
  63. javaType="java.util.List"
  64. select="com.iformall.mapper.WxShopMapper.findShopVoList">
  65. </collection>
  66. </resultMap>
  67. <select id="findMerchantVoList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  68. select
  69. <include refid="allMerchantVoColumns"/>
  70. from wx_coupon_merchant cm
  71. left join wx_merchant m on m.id = cm.merchant_id
  72. where cm.status = 0
  73. and cm.product_id = #{productId}
  74. </select>
  75. <sql id="allMerchantNameColumns">
  76. m.id,m.name,m.status
  77. </sql>
  78. <sql id="allMerchantBaseColumns">
  79. m.id,
  80. m.img_url,m.name,m.link_phone,m.status,m.business_id,m.sub_business_id,
  81. cm.parameter
  82. </sql>
  83. <select id="findMerchantNameList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  84. select
  85. <include refid="allMerchantNameColumns"/>
  86. from wx_coupon_merchant cm
  87. left join wx_merchant m on m.id = cm.merchant_id
  88. where cm.status = 0
  89. and cm.product_id = #{productId}
  90. </select>
  91. <select id="findMerchantBaseList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  92. select
  93. <include refid="allMerchantBaseColumns"/>
  94. from wx_coupon_merchant cm
  95. left join wx_merchant m on m.id = cm.merchant_id
  96. where cm.status = 0
  97. and cm.product_id = #{productId}
  98. </select>
  99. </mapper>