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.
 
 
 
 
 

100 righe
3.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.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 <include refid="allColumns" /> from wx_level_merchant
  45. <include refid="dynamicWhereConditions" />
  46. </select>
  47. <resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxLevelMerchantCVo">
  48. <id column="id" jdbcType="BIGINT" property="id"/>
  49. <result column="name" jdbcType="VARCHAR" property="merchantName"/>
  50. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
  51. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  52. <result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
  53. <result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
  54. <result column="discount" jdbcType="INTEGER" property="discount" />
  55. </resultMap>
  56. <sql id="allCVoColumns">
  57. m.id,m.name,m.link_phone,
  58. s.shop_number,
  59. mb.building_name,
  60. mf.floor_name,
  61. lm.discount
  62. </sql>
  63. <select id="findListCVo" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="CVoResultMap">
  64. select <include refid="allCVoColumns" />
  65. from wx_level_merchant lm
  66. inner join wx_merchant m on m.status = 1
  67. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  68. left join wx_shop s on ms.shop_id = s.id
  69. left join wx_mall_building mb on s.building = mb.id
  70. left join wx_mall_floor mf on s.floor = mf.id
  71. <if test=" null != levelId ">
  72. and `level_id` = #{levelId}
  73. </if>
  74. </select>
  75. </mapper>