后台服务
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

WxLevelMerchantMapper.xml 4.1 KiB

2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. </resultMap>
  63. <sql id="allCVoColumns">
  64. m.id,m.name,m.link_phone,
  65. lm.discount,m.link_line_phone
  66. </sql>
  67. <sql id="allCVoDynamicWhereConditions">
  68. where 1 = 1
  69. <if test=" null != tenantId and '' != tenantId">
  70. and lm.`tenant_id` = #{tenantId}
  71. </if>
  72. <if test=" null != parentTenantId and '' != parentTenantId">
  73. and lm.`parent_tenant_id` = #{parentTenantId}
  74. </if>
  75. <if test=" null != merchantId ">
  76. and lm.merchant_id = #{merchantId}
  77. </if>
  78. <if test=" null != levelId ">
  79. and lm.level_id = #{levelId}
  80. </if>
  81. <if test=" null != discount ">
  82. and lm.discount = #{discount}
  83. </if>
  84. <if test=" null != sortColumns">order by ${sortColumns}</if>
  85. </sql>
  86. <select id="findListCVo" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="CVoResultMap">
  87. select
  88. <include refid="allCVoColumns"/>
  89. from wx_level_merchant lm
  90. inner join wx_merchant m on m.status = 1 and lm.merchant_id = m.id
  91. <include refid="allCVoDynamicWhereConditions"/>
  92. </select>
  93. </mapper>