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

118 строки
3.9 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.WxLevelMerchantMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelMerchant">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  8. <result column="level_id" jdbcType="BIGINT" property="levelId"/>
  9. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  10. <result column="discount" jdbcType="INTEGER" property="discount"/>
  11. </resultMap>
  12. <sql id="allColumns">
  13. `id`,`tenant_id`,`merchant_id`,`level_id`,`create_date`,`discount`
  14. </sql>
  15. <sql id="dynamicWhereConditions">
  16. where 1 = 1
  17. <if test=" null != id ">
  18. and `id` = #{id}
  19. </if>
  20. <if test=" null != tenantId ">
  21. and `tenant_id` = #{tenantId}
  22. </if>
  23. <if test=" null != merchantId ">
  24. and `merchant_id` = #{merchantId}
  25. </if>
  26. <if test=" null != levelId ">
  27. and `level_id` = #{levelId}
  28. </if>
  29. <if test=" null != createDate ">
  30. and `create_date` = #{createDate}
  31. </if>
  32. <if test=" null != discount ">
  33. and `discount` = #{discount}
  34. </if>
  35. <if test=" null != ids ">
  36. and id in
  37. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  38. #{idItem}
  39. </foreach>
  40. </if>
  41. <if test=" null != sortColumns">order by ${sortColumns}</if>
  42. </sql>
  43. <select id="findList" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="BaseResultMap">
  44. select
  45. <include refid="allColumns"/>
  46. from wx_level_merchant
  47. <include refid="dynamicWhereConditions"/>
  48. </select>
  49. <resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxLevelMerchantCVo">
  50. <id column="id" jdbcType="BIGINT" property="id"/>
  51. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  52. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  53. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  54. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  55. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  56. <result column="discount" jdbcType="INTEGER" property="discount"/>
  57. <result column="link_line_phone" property="linkLinePhone"/>
  58. <collection column="{merchantId=id}" property="shopVoList"
  59. ofType="com.iformall.domain.vo.WxShopVo"
  60. javaType="java.util.List"
  61. select="com.iformall.mapper.WxShopMapper.findShopVoList">
  62. </collection>
  63. </resultMap>
  64. <sql id="allCVoColumns">
  65. m.id,m.name,m.link_phone,
  66. lm.discount,m.link_line_phone
  67. </sql>
  68. <sql id="allCVoDynamicWhereConditions">
  69. where 1 = 1
  70. <if test=" null != tenantId ">
  71. and lm.tenant_id = #{tenantId}
  72. </if>
  73. <if test=" null != merchantId ">
  74. and lm.merchant_id = #{merchantId}
  75. </if>
  76. <if test=" null != levelId ">
  77. and lm.level_id = #{levelId}
  78. </if>
  79. <if test=" null != discount ">
  80. and lm.discount = #{discount}
  81. </if>
  82. <if test=" null != sortColumns">order by ${sortColumns}</if>
  83. </sql>
  84. <select id="findListCVo" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="CVoResultMap">
  85. select
  86. <include refid="allCVoColumns"/>
  87. from wx_level_merchant lm
  88. inner join wx_merchant m on m.status = 1 and lm.merchant_id = m.id
  89. <include refid="allCVoDynamicWhereConditions"/>
  90. </select>
  91. </mapper>