fix
Helius
2021-11-11 9bbcd9f08c311e5082271d9eb4db8dd19de87b0e
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -1300,7 +1300,21 @@
        <if test="record.shopId != null">
           and a.shop_id=#{record.shopId}
        </if>
      <if test="record.beginTime != null">
         and date_format(b.datatime, '%Y-%m-%d') > date_format(#{record.beginTime}, '%Y-%m-%d')
      </if>
      <if test="record.endTime != null">
         and date_format(#{record.endTime}, '%Y-%m-%d') > date_format(b.datatime, '%Y-%m-%d')
      </if>
      <if test="record.beaultId != null">
         and a.su_id=#{record.beaultId}
      </if>
      <if test="record.vipQueryKey != null and record.vipQueryKey != ''">
         and c.vip_name like concat('%', #{record.vipQueryKey}, '%')
      </if>
      <if test="record.beginTime == null and record.endTime == null">
      and date_format(b.datatime, '%Y-%m')=date_format(now(), '%Y-%m')
      </if>
      group by date_format(b.datatime, '%Y-%m-%d'), a.su_id, c.ID
      <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
         order by date_format(b.datatime, '%Y-%m-%d') desc, a.su_id
@@ -1325,8 +1339,28 @@
          from sys_users a
                 left join achieve_new b on a.su_id=b.beault_id
                 left join sys_vip_info c on b.vip_id=c.ID
          where a.company_id=#{record.companyId} and a.shop_id=#{record.shopId}
         where 1=1
         <if test="record.companyId != null">
            and a.company_id=#{record.companyId}
         </if>
         <if test="record.shopId != null">
            and a.shop_id=#{record.shopId}
         </if>
         <if test="record.beginTime != null">
            and date_format(b.datatime, '%Y-%m-%d') > date_format(#{record.beginTime}, '%Y-%m-%d')
         </if>
         <if test="record.endTime != null">
            and date_format(#{record.endTime}, '%Y-%m-%d') > date_format(b.datatime, '%Y-%m-%d')
         </if>
         <if test="record.beaultId != null">
            and a.su_id=#{record.beaultId}
         </if>
         <if test="record.vipQueryKey != null and record.vipQueryKey != ''">
            and c.vip_name like concat('%', #{record.vipQueryKey}, '%')
         </if>
         <if test="record.beginTime == null and record.endTime == null">
            and date_format(b.datatime, '%Y-%m')=date_format(now(), '%Y-%m')
         </if>
          group by date_format(b.datatime, '%Y-%m-%d'), a.su_id, c.ID
      ) a
   </select>