|
@@ -31,9 +31,9 @@
|
|
|
<result column="created_time" property="createdTime" />
|
|
|
<result column="updated_time" property="updatedTime" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<!-- 通用查询VO映射结果 -->
|
|
|
- <resultMap id="VoResultMap" type="com.qs.mp.channel.domain.vo.ChannelVo">
|
|
|
+ <resultMap id="VoResultMap" type="com.qs.mp.channel.domain.vo.ChannelVO">
|
|
|
<id column="channel_id" property="channelId" />
|
|
|
<result column="channel_no" property="channelNo" />
|
|
|
<result column="name" property="name" />
|
|
@@ -55,32 +55,32 @@
|
|
|
<result column="frozen_money" property="frozenMoney" />
|
|
|
<result column="certify_status" property="certifyStatus" />
|
|
|
<result column="verify_status" property="verifyStatus" />
|
|
|
- <result column="biz_license" property="bizLicense" />
|
|
|
+ <result column="biz_license_pic" property="bizLicensePic" />
|
|
|
<result column="door_pic" property="doorPic" />
|
|
|
<result column="memo" property="memo" />
|
|
|
<result column="created_time" property="createdTime" />
|
|
|
<result column="updated_time" property="updatedTime" />
|
|
|
<result column="parentName" property="parentName" />
|
|
|
<association property="siteCnt" javaType="java.lang.Integer" select="getChannelSiteCnt" column="{channelNo=channelNo}" />
|
|
|
- <association property="userCnt" javaType="java.lang.Integer" select="com.qs.mp.channel.mapper.ChannelUserRelMapper.getChannelUserCnt" column="{channelNo=channelNo}" />
|
|
|
+ <association property="userCnt" javaType="java.lang.Integer" select="com.qs.mp.channel.mapper.ChannelUserRelMapper.getChannelUserCnt" column="{channelNo=channelNo}" />
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
channel_id, channel_no, name, parent_id, level, site_type, comm_rate, province, province_id, city, city_id, area, area_id, address, contact, mobile, user_id, money, frozen_money, certify_status, verify_status, biz_license_pic, door_pic, memo, created_time, updated_time
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<!-- 查询子渠道信息 -->
|
|
|
<select id="selectChannelVoList" resultMap="VoResultMap">
|
|
|
select t1.* , t2.siteCnt, t3.userCnt, t4.name parentName
|
|
|
from mp_channel t1
|
|
|
- left join (select parent_id, count(*) as siteCnt from mp_channel where `level` = 0 GROUP BY parent_id ) t2 on t1.channel_id = t2.parent_id
|
|
|
+ left join (select parent_id, count(*) as siteCnt from mp_channel where `level` = 0 GROUP BY parent_id ) t2 on t1.channel_id = t2.parent_id
|
|
|
left join (select channel_id, count(user_id) as userCnt from mp_channel_user_rel GROUP BY channel_id ) t3 on t1.channel_id = t3.channel_id
|
|
|
left join mp_channel t4 on t1.parent_id = t4.channel_id
|
|
|
${ew.customSqlSegment}
|
|
|
order by a.channel_id desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 查询渠道及其子渠道经销商用户数总和 -->
|
|
|
<select id="getChannelSiteCnt" resultType="integer">
|
|
|
select count(t1.channel_id) as siteCnt
|