后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TtMerchantPoiMapper.xml 6.3 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.TtMerchantPoiMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtMerchantPoi">
  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="supplier_ext_id" jdbcType="VARCHAR" property="supplierExtId"/>
  9. <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
  10. <result column="merchant_province" jdbcType="VARCHAR" property="merchantProvince"/>
  11. <result column="merchant_city" jdbcType="VARCHAR" property="merchantCity"/>
  12. <result column="merchant_addr" jdbcType="VARCHAR" property="merchantAddr"/>
  13. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  14. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  15. <result column="amap_id" jdbcType="VARCHAR" property="amapId"/>
  16. <result column="extra" jdbcType="VARCHAR" property="extra"/>
  17. <result column="poi_id" jdbcType="VARCHAR" property="poiId"/>
  18. <result column="poi_name" jdbcType="VARCHAR" property="poiName"/>
  19. <result column="province" jdbcType="VARCHAR" property="province"/>
  20. <result column="city" jdbcType="VARCHAR" property="city"/>
  21. <result column="address" jdbcType="VARCHAR" property="address"/>
  22. <result column="task_id" jdbcType="VARCHAR" property="taskId"/>
  23. <result column="match_status" jdbcType="INTEGER" property="matchStatus"/>
  24. <result column="mismatch_status_desc" jdbcType="VARCHAR" property="mismatchStatusDesc"/>
  25. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  26. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  27. <result column="supplier_id" jdbcType="VARCHAR" property="supplierId"/>
  28. <result column="sync_status" jdbcType="INTEGER" property="syncStatus"/>
  29. <result column="last_sync_status" jdbcType="INTEGER" property="lastSyncStatus"/>
  30. <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>
  31. <result column="biz_licence_path" jdbcType="VARCHAR" property="bizLicencePath"/>
  32. <result column="biz_licence_status" jdbcType="VARCHAR" property="bizLicenceStatus"/>
  33. <result column="contract_path" jdbcType="VARCHAR" property="contractPath"/>
  34. <result column="contract_status" jdbcType="VARCHAR" property="contractStatus"/>
  35. <result column="qual_material" jdbcType="VARCHAR" property="qualMaterial"/>
  36. <result column="qual_material_status" jdbcType="VARCHAR" property="qualMaterialStatus"/>
  37. <result column="additional_qual" jdbcType="VARCHAR" property="additionalQual"/>
  38. <result column="additional_qual_status" jdbcType="VARCHAR" property="additionalQualStatus"/>
  39. <result column="expire_time" jdbcType="VARCHAR" property="expireTime"/>
  40. </resultMap>
  41. <sql id="allColumns">
  42. `id`,`tenant_id`,`parent_tenant_id`,`supplier_ext_id`,
  43. `merchant_name`,`merchant_province`,`merchant_city`,`merchant_addr`,`longitude`,`latitude`,
  44. `amap_id`,`extra`,
  45. `poi_id`,`poi_name`,`province`,`city`,`address`,
  46. `task_id`,`match_status`,`mismatch_status_desc`,
  47. `create_date`,`update_date`,
  48. `supplier_id`,`sync_status`,`last_sync_status`,`fail_reason`,
  49. `biz_licence_path`,`biz_licence_status`,`contract_path`,`contract_status`,`qual_material`,`qual_material_status`,`additional_qual`,`additional_qual_status`,`expire_time`
  50. </sql>
  51. <sql id="dynamicWhereConditions">
  52. where is_del = 0
  53. <if test=" null != id ">
  54. and `id` = #{id}
  55. </if>
  56. <if test=" null != tenantId and '' != tenantId">
  57. and `tenant_id` = #{tenantId}
  58. </if>
  59. <if test=" null != parentTenantId and '' != parentTenantId">
  60. and `parent_tenant_id` = #{parentTenantId}
  61. </if>
  62. <if test=" null != supplierExtId and '' != supplierExtId">
  63. and `supplier_ext_id` = #{supplierExtId}
  64. </if>
  65. <if test=" null != poiId and ''!= poiId ">
  66. and `poi_id` = #{poiId}
  67. </if>
  68. <if test=" null != poiName and ''!= poiName ">
  69. and `poi_name` like concat('%', #{poiName},'%')
  70. </if>
  71. <if test=" null != merchantName and ''!= merchantName ">
  72. and `merchant_name` like concat('%', #{merchantName},'%')
  73. </if>
  74. <if test=" null != taskId and ''!= taskId ">
  75. and `task_id` = #{taskId}
  76. </if>
  77. <if test=" null != matchStatus">
  78. and `match_status` = #{matchStatus}
  79. </if>
  80. <if test=" null != supplierId and '' != supplierId">
  81. and `supplier_id` = #{supplierId}
  82. </if>
  83. <if test=" null != syncStatus">
  84. and `sync_status` = #{syncStatus}
  85. </if>
  86. <if test=" null != lastSyncStatus">
  87. and `last_sync_status` = #{lastSyncStatus}
  88. </if>
  89. <if test=" null != ids ">
  90. and `id` in
  91. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  92. #{idItem}
  93. </foreach>
  94. </if>
  95. <if test=" null != sortColumns">order by ${sortColumns}</if>
  96. </sql>
  97. <select id="findList" parameterType="com.iformall.domain.po.TtMerchantPoi" resultMap="BaseResultMap">
  98. select
  99. <include refid="allColumns"/>
  100. from tt_merchant_poi
  101. <include refid="dynamicWhereConditions"/>
  102. </select>
  103. <select id="findIdList" parameterType="com.iformall.domain.po.TtMerchantPoi" resultType="Long">
  104. select id
  105. from tt_merchant_poi
  106. <include refid="dynamicWhereConditions"/>
  107. </select>
  108. <select id="findTaskIdList" parameterType="com.iformall.domain.po.TtMerchantPoi" resultType="String">
  109. select distinct `tenant_id`,`parent_tenant_id`,`task_id`
  110. from tt_merchant_poi
  111. <include refid="dynamicWhereConditions"/>
  112. </select>
  113. <update id="deleteByUpdate" parameterType="Long">
  114. update tt_merchant_poi set is_del = 1
  115. where id = #{id}
  116. </update>
  117. </mapper>