|
@@ -34,9 +34,8 @@
|
|
|
<result property="total" column="total"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
</resultMap>
|
|
|
- <resultMap type="com.benyun.core.entity.bo.BrandAddrTypeDistribution" id="AddrTypeDisResult">
|
|
|
+ <resultMap type="com.benyun.core.entity.bo.BrandAddrDistribution" id="AddrDisResult">
|
|
|
<result property="addrCode" column="addr_code"/>
|
|
|
- <result property="industryCode" column="industry_code"/>
|
|
|
<result property="count" column="count"/>
|
|
|
</resultMap>
|
|
|
<select id="searchList" resultMap="BrandResult">
|
|
@@ -54,17 +53,14 @@
|
|
|
db.brand_name as brand_name,
|
|
|
brand_img,
|
|
|
index_score,
|
|
|
- enterprise_name,
|
|
|
cover_city_count,
|
|
|
total,
|
|
|
bbs.update_time as update_time
|
|
|
FROM
|
|
|
- ddt_brand db,
|
|
|
- ddt_enterprise de,
|
|
|
- bl_brand_statistics bbs
|
|
|
+ `ddt_brand` db,
|
|
|
+ `bl_brand_statistics` bbs
|
|
|
WHERE
|
|
|
- db.enterprise_usci = de.enterprise_usci
|
|
|
- AND bbs.brand_id = db.brand_id
|
|
|
+ bbs.brand_id = db.brand_id
|
|
|
<if test="text != null">
|
|
|
AND db.brand_name LIKE concat('%',#{text},'%')
|
|
|
</if>
|
|
@@ -85,49 +81,5 @@
|
|
|
<if test="coverUp != null">
|
|
|
AND cover_city_count <![CDATA[<=]]> #{coverUp}
|
|
|
</if>
|
|
|
- <if test="addrCode != null">
|
|
|
- <foreach collection="addrCode" item="addr_code" open="AND addr_code IN (" separator="," close=")">
|
|
|
- #{addr_code,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="orderBy == 1">
|
|
|
- ORDER BY
|
|
|
- db.update_time
|
|
|
- </if>
|
|
|
- <if test="orderBy == 2">
|
|
|
- ORDER BY
|
|
|
- db.total
|
|
|
- </if>
|
|
|
- <if test="orderBy == 3">
|
|
|
- ORDER BY
|
|
|
- db.brand_id
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="searchAddrTypeDisByMulti" resultMap="AddrTypeDisResult">
|
|
|
- SELECT
|
|
|
- addr_code,
|
|
|
- db.industry_code,
|
|
|
- COUNT(*) count
|
|
|
- FROM
|
|
|
- `ddt_brand` db,
|
|
|
- `ddt_enterprise` de
|
|
|
- WHERE
|
|
|
- db.enterprise_usci = de.enterprise_usci
|
|
|
- AND db.enterprise_usci IS NOT NULL
|
|
|
- <if test="addrCodes != null">
|
|
|
- <foreach collection="addrCodes" item="addrCode" open="AND addr_code IN (" separator="," close=")">
|
|
|
- #{addrCode,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="industryCodes != null">
|
|
|
- <foreach collection="industryCodes" item="industryCode" open="AND db.industry_code IN (" separator="," close=")">
|
|
|
- #{industryCode,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- GROUP BY
|
|
|
- addr_code,
|
|
|
- db.industry_code
|
|
|
- ORDER BY count DESC;
|
|
|
</select>
|
|
|
-
|
|
|
</mapper>
|