|  | @@ -57,8 +57,8 @@
 | 
	
		
			
				|  |  |          t1.reference_amount,
 | 
	
		
			
				|  |  |          t1.total_amount,
 | 
	
		
			
				|  |  |          t1.remarks,
 | 
	
		
			
				|  |  | -        t2.user_name as 'itemCreateName',
 | 
	
		
			
				|  |  | -        t3.user_name as 'promoterCreateName',
 | 
	
		
			
				|  |  | +        ifnull(t2.user_name,'-') as 'itemCreateName',
 | 
	
		
			
				|  |  | +        ifnull(t3.user_name,'-') as 'promoterCreateName',
 | 
	
		
			
				|  |  |          t1.create_time,
 | 
	
		
			
				|  |  |          t1.update_time
 | 
	
		
			
				|  |  |          FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
 | 
	
	
		
			
				|  | @@ -71,7 +71,10 @@
 | 
	
		
			
				|  |  |          ) t3 on t1.promoter_id = t3.promoter_id
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              <if test="itemId != null  and itemId != '' ">and t1.item_id = #{itemId}</if>
 | 
	
		
			
				|  |  | -            <if test="itemTitle != null  and itemTitle != ''">and t1.item_title = #{itemTitle}</if>
 | 
	
		
			
				|  |  | +            <if test="itemTitle != null  and itemTitle != ''">and t1.item_title like concat('%',
 | 
	
		
			
				|  |  | +                #{itemTitle},
 | 
	
		
			
				|  |  | +                '%')
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  |              <if test="promoterId != null and promoterId != '' ">and t1.promoter_id = #{promoterId}</if>
 | 
	
		
			
				|  |  |              <if test="promoterName != null  and promoterName != ''">and t1.promoter_name like concat('%',
 | 
	
		
			
				|  |  |                  #{promoterName},
 | 
	
	
		
			
				|  | @@ -81,7 +84,7 @@
 | 
	
		
			
				|  |  |              <if test="endDate != null and endDate != ''">and t1.stat_date <= #{endDate}</if>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  | -        order by t1.create_time desc
 | 
	
		
			
				|  |  | +        order by t1.stat_date desc
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectKuaishouRewardBaseInfoById" parameterType="java.lang.Long"
 | 
	
	
		
			
				|  | @@ -143,21 +146,18 @@
 | 
	
		
			
				|  |  |          WHERE promoter_id = #{promoterId}
 | 
	
		
			
				|  |  |            AND item_id = #{itemId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | -    <select id="totalListInfo" resultMap="KuaishouRewardBaseInfoResult">
 | 
	
		
			
				|  |  | +    <select id="totalListInfo" resultType="com.alibaba.fastjson.JSONObject">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          SELECT * from (
 | 
	
		
			
				|  |  |          SELECT t1.id,
 | 
	
		
			
				|  |  | -        t1.item_id,
 | 
	
		
			
				|  |  | -        t1.item_title,
 | 
	
		
			
				|  |  | -        t1.promoter_id,
 | 
	
		
			
				|  |  | -        t1.promoter_name,
 | 
	
		
			
				|  |  | -        sum(t1.current_settlement_num) as 'total_settlement_num',
 | 
	
		
			
				|  |  | -        sum(t1.anchor_amount) as 'anchor_amount',
 | 
	
		
			
				|  |  | -        sum(t1.reference_amount) as 'reference_amount',
 | 
	
		
			
				|  |  | -        sum(t1.reference_amount + t1.anchor_amount ) as 'total_amount',
 | 
	
		
			
				|  |  | -        t2.user_name as 'itemCreateName',
 | 
	
		
			
				|  |  | -        t3.user_name as 'promoterCreateName',
 | 
	
		
			
				|  |  | -        max(t1.create_time) as 'createTime'
 | 
	
		
			
				|  |  | +        t1.item_id as 'itemId',
 | 
	
		
			
				|  |  | +        t1.item_title as 'itemTitle',
 | 
	
		
			
				|  |  | +        t1.promoter_id as 'promoterId',
 | 
	
		
			
				|  |  | +        t1.promoter_name as 'promoterName',
 | 
	
		
			
				|  |  | +        sum(t1.current_settlement_num) as 'totalSettlementNum',
 | 
	
		
			
				|  |  | +        max(t1.stat_date) as 'maxDate',
 | 
	
		
			
				|  |  | +        ifnull(t2.user_name,'-') as 'itemCreateName',
 | 
	
		
			
				|  |  | +        ifnull(t3.user_name,'-') as 'promoterCreateName'
 | 
	
		
			
				|  |  |          FROM kuaishou_reward_base_info t1 LEFT JOIN kuaishou_item_list t2
 | 
	
		
			
				|  |  |          on t1.item_id = t2.item_id
 | 
	
		
			
				|  |  |          LEFT JOIN (
 | 
	
	
		
			
				|  | @@ -174,26 +174,11 @@
 | 
	
		
			
				|  |  |                  #{promoterName},
 | 
	
		
			
				|  |  |                  '%')
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | -            <if test="startDate != null and startDate != ''">and t1.stat_date >= #{startDate}</if>
 | 
	
		
			
				|  |  | -            <if test="endDate != null and endDate != ''">and t1.stat_date <= #{endDate}</if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        <if test="itemId != null and promoterId != null">
 | 
	
		
			
				|  |  | -            group by t1.item_id,t1.promoter_id
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -        <if test="itemId == null and promoterId == null">
 | 
	
		
			
				|  |  | -            group by t1.item_id,t1.promoter_id
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        <if test="itemId != null and  promoterId == null ">
 | 
	
		
			
				|  |  | -            group by t1.item_id
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -        <if test="promoterId != null  and itemId == null ">
 | 
	
		
			
				|  |  | -            group by t1.promoter_id
 | 
	
		
			
				|  |  | -        </if>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        and t1.promoter_type = 1
 | 
	
		
			
				|  |  | +        group by t1.promoter_id,t1.item_id
 | 
	
		
			
				|  |  |          ) t
 | 
	
		
			
				|  |  | -        order by t.createTime desc
 | 
	
		
			
				|  |  | +        order by t.maxDate desc
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -274,6 +259,7 @@
 | 
	
		
			
				|  |  |          kuaishou_reward_base_info
 | 
	
		
			
				|  |  |          (
 | 
	
		
			
				|  |  |          item_id,
 | 
	
		
			
				|  |  | +        promoter_type,
 | 
	
		
			
				|  |  |          item_title,
 | 
	
		
			
				|  |  |          promoter_id,
 | 
	
		
			
				|  |  |          promoter_name,
 | 
	
	
		
			
				|  | @@ -290,6 +276,7 @@
 | 
	
		
			
				|  |  |          <foreach collection="infoList" item="info" separator=",">
 | 
	
		
			
				|  |  |              (
 | 
	
		
			
				|  |  |              #{info.itemId},
 | 
	
		
			
				|  |  | +            #{info.promoterType},
 | 
	
		
			
				|  |  |              #{info.itemTitle},
 | 
	
		
			
				|  |  |              #{info.promoterId},
 | 
	
		
			
				|  |  |              #{info.promoterName},
 |