935090232@qq.com
2021-04-03 00efd2e4db8157ece4116c956c314803ed073042
zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml
@@ -13,18 +13,42 @@
      from score_use_record a
      left join sys_shop_info b on a.shop_id=b.id
      left join sys_users c on a.opration_user_id=c.su_id
      where a.open_id=#{record.userId}
        <where>
            <if test="(record.userId!=null and record.userId!='') and (record.vipId!=null and record.vipId!='')">
                and (a.open_id=#{record.userId} or a.vip_id=#{record.vipId})
            </if>
            <if test="(record.userId!=null and record.userId!='') and record.vipId==null">
                and a.open_id=#{record.userId}
            </if>
            <if test="(record.vipId!=null and record.vipId!='') and record.userId==null">
                and a.vip_id=#{record.vipId}
            </if>
            <if test="record.remarks!=null and record.remarks!=''">
                and a.remarks like concat('%',#{record.remarks},'%')
            </if>
            <if test="record.queryTime!=null and record.queryTime!=''">
      and DATE_FORMAT(a.create_time,'%Y-%m')=#{record.queryTime}
            </if>
            <if test="record.beginTime != null and record.endTime!=null">
                and (date(a.create_time) between #{record.beginTime} and #{record.endTime})
            </if>
      <if test="record.revenueType==1">
         and a.rec_num>0
      </if>
      <if test="record.revenueType==2">
         <![CDATA[ and a.rec_num<0 ]]>
      </if>
        </where>
      order by a.create_time desc
   </select>
</mapper>