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

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