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

132 строки
4.3 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,
  50. m.img_url,m.name,m.link_phone,m.status,m.business_id,
  51. s.addr,s.shop_number,s.baidu_poi,
  52. mb.building_name,mf.floor_name,
  53. cm.parameter
  54. </sql>
  55. <resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
  56. <id column="id" jdbcType="BIGINT" property="id"/>
  57. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
  58. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  59. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  60. <result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
  61. <result column="business_id" jdbcType="INTEGER" property="businessId"/>
  62. <result column="parameter" jdbcType="VARCHAR" property="parameter"/>
  63. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  64. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  65. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  66. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  67. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  68. </resultMap>
  69. <select id="findMerchantVoList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  70. select
  71. <include refid="allMerchantVoColumns"/>
  72. from wx_coupon_merchant cm
  73. left join wx_merchant m on m.id = cm.merchant_id
  74. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  75. left join wx_shop s on ms.shop_id = s.id
  76. left join wx_mall_building mb on s.building = mb.id
  77. left join wx_mall_floor mf on s.floor = mf.id
  78. where cm.status = 0
  79. and cm.product_id = #{productId}
  80. </select>
  81. <sql id="allMerchantNameColumns">
  82. m.id,m.name,m.status
  83. </sql>
  84. <sql id="allMerchantBaseColumns">
  85. m.id,
  86. m.img_url,m.name,m.link_phone,m.status,m.business_id,
  87. cm.parameter
  88. </sql>
  89. <select id="findMerchantNameList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  90. select
  91. <include refid="allMerchantNameColumns"/>
  92. from wx_coupon_merchant cm
  93. left join wx_merchant m on m.id = cm.merchant_id
  94. where cm.status = 0
  95. and cm.product_id = #{productId}
  96. </select>
  97. <select id="findMerchantBaseList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
  98. select
  99. <include refid="allMerchantBaseColumns"/>
  100. from wx_coupon_merchant cm
  101. left join wx_merchant m on m.id = cm.merchant_id
  102. where cm.status = 0
  103. and cm.product_id = #{productId}
  104. </select>
  105. </mapper>