Commit 311ac0de by levphon

V1.7.0需求:运营报表 多线程批量解析地址

1 parent 3222ca18
...@@ -62,8 +62,7 @@ public class ReportDeviceDTO extends BaseOrgDto { ...@@ -62,8 +62,7 @@ public class ReportDeviceDTO extends BaseOrgDto {
/** /**
* 定位时间 * 定位时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String gpsTime;
private Date gpsTime;
/** /**
* 定位地点 * 定位地点
......
...@@ -2,6 +2,7 @@ package cn.com.glsx.admin.modules.model.export; ...@@ -2,6 +2,7 @@ package cn.com.glsx.admin.modules.model.export;
import cn.com.glsx.admin.modules.model.BaseOrgDto; import cn.com.glsx.admin.modules.model.BaseOrgDto;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
...@@ -25,49 +26,75 @@ public class ReportDeviceExport extends BaseOrgDto { ...@@ -25,49 +26,75 @@ public class ReportDeviceExport extends BaseOrgDto {
/** /**
* 业务工单号 * 业务工单号
*/ */
@ExcelProperty("业务工单号")
private String bizOrderNo; private String bizOrderNo;
/** /**
* 设备号 * 设备号
*/ */
@ExcelProperty("设备号")
private String sns; private String sns;
/** /**
* 车牌号 * 车牌号
*/ */
@ExcelProperty("车牌号")
private String licensePlate; private String licensePlate;
/** /**
* 是否激活
*/
@ExcelProperty("是否激活")
private String activateFlag;
/**
* 车主姓名 * 车主姓名
*/ */
@ExcelProperty("姓名")
private String ownerName; private String ownerName;
/** /**
* 车架号VIN码 * 车架号VIN码
*/ */
@ExcelProperty("车架号")
private String vin; private String vin;
@ExcelProperty("所属组织")
private String belongLevels;
/** /**
* 设备激活时间 * 设备激活时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty("设备激活时间")
private Date activateTime; private Date activateTime;
/** /**
* 定位时间 * 定位时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ExcelProperty("定位时间")
private Date gpsTime; private String gpsTime;
/** /**
* 定位地点 * 定位地点
*/ */
@ExcelProperty("定位地点")
private String gpsAddress; private String gpsAddress;
/** /**
* 工单激活时间 * 工单激活时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty("工单激活时间")
private Date woActivateTime; private Date woActivateTime;
@ExcelProperty("租赁属性")
private String rentP;
@ExcelProperty("车辆说明")
private String vehicleRemark;
@ExcelProperty("备注")
private String remark;
} }
...@@ -2,6 +2,7 @@ package cn.com.glsx.admin.modules.model.export; ...@@ -2,6 +2,7 @@ package cn.com.glsx.admin.modules.model.export;
import cn.com.glsx.admin.modules.model.BaseOrgDto; import cn.com.glsx.admin.modules.model.BaseOrgDto;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
...@@ -25,48 +26,69 @@ public class ReportVehicleExport extends BaseOrgDto { ...@@ -25,48 +26,69 @@ public class ReportVehicleExport extends BaseOrgDto {
/** /**
* 业务工单号 * 业务工单号
*/ */
@ExcelProperty("业务工单号")
private String bizOrderNo; private String bizOrderNo;
/** /**
* 车牌号 * 车牌号
*/ */
@ExcelProperty("车牌号")
private String licensePlate; private String licensePlate;
/** /**
* 车主姓名 * 车主姓名
*/ */
@ExcelProperty("姓名")
private String ownerName; private String ownerName;
/** /**
* 车架号VIN码 * 车架号VIN码
*/ */
@ExcelProperty("车架号")
private String vin; private String vin;
/** /**
* 设备号
*/
private String sns;
/**
* 设备组合 * 设备组合
*/ */
@ExcelProperty("设备组合")
private String deviceCompose; private String deviceCompose;
/** /**
* 工单创建时间 * 工单创建时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty("工单接收时间")
private Date createdDate; private Date createdDate;
/** /**
* 车辆激活时间(也是车辆创建时间) * 车辆激活时间(也是车辆创建时间)
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ExcelProperty("车辆激活时间")
private Date activateTime; private Date activateTime;
@ExcelProperty("所属组织")
private String belongLevels;
@ExcelProperty("店面名称")
private String shopName;
@ExcelProperty("车辆说明")
private String remark;
@ExcelProperty("车型")
private String modelName;
/** /**
* 激活人 * 激活人
*/ */
@ExcelProperty("激活人")
private String activator; private String activator;
/**
* 设备号
*/
@ExcelProperty("设备号")
private String sns;
} }
...@@ -8,15 +8,27 @@ import cn.com.glsx.admin.modules.model.export.ReportDeviceExport; ...@@ -8,15 +8,27 @@ import cn.com.glsx.admin.modules.model.export.ReportDeviceExport;
import cn.com.glsx.admin.modules.model.export.ReportVehicleExport; import cn.com.glsx.admin.modules.model.export.ReportVehicleExport;
import cn.com.glsx.admin.modules.model.param.ReportDeviceSearch; import cn.com.glsx.admin.modules.model.param.ReportDeviceSearch;
import cn.com.glsx.admin.modules.model.param.ReportVehicleSearch; import cn.com.glsx.admin.modules.model.param.ReportVehicleSearch;
import cn.com.glsx.admin.modules.remote.RemoteGpsBsService;
import cn.com.glsx.devicemonitor.api.dto.response.GpsBsData;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -31,6 +43,13 @@ public class OpereportService extends AbstractCommonService { ...@@ -31,6 +43,13 @@ public class OpereportService extends AbstractCommonService {
@Autowired @Autowired
private OrganizationApiService organizationApiService; private OrganizationApiService organizationApiService;
@Autowired
private RemoteGpsBsService remoteGpsBsService;
@Autowired
@Qualifier("threadPoolTaskExecutor")
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
public PageInfo<ReportVehicleDTO> vehicleSearch(ReportVehicleSearch search) { public PageInfo<ReportVehicleDTO> vehicleSearch(ReportVehicleSearch search) {
setOrgCheckedAuth(search); setOrgCheckedAuth(search);
...@@ -63,6 +82,23 @@ public class OpereportService extends AbstractCommonService { ...@@ -63,6 +82,23 @@ public class OpereportService extends AbstractCommonService {
List<ReportDeviceDTO> list = vehicleDeviceMapper.searchReportDevice(search); List<ReportDeviceDTO> list = vehicleDeviceMapper.searchReportDevice(search);
List<String> snList = list.stream().map(ReportDeviceDTO::getSns).collect(Collectors.toList());
Map<String, GpsBsData> gpsBsDataMap = remoteGpsBsService.getLastGpsBsBatchBySns(snList);
list.forEach(rdd -> {
GpsBsData gpsBsData = gpsBsDataMap.get(rdd.getSns());
if (gpsBsData != null) {
if (gpsBsData.getGpsLocation() != null) {
rdd.setGpsTime(gpsBsData.getGpsLocation().getDateTime());
rdd.setGpsAddress(gpsBsData.getGpsLocation().getAddress());
} else if (gpsBsData.getBsLocation() != null) {
rdd.setGpsTime(gpsBsData.getBsLocation().getDateTime());
rdd.setGpsAddress(gpsBsData.getBsLocation().getAddress());
}
}
});
organizationApiService.drawAllLevel(list); organizationApiService.drawAllLevel(list);
return new PageInfo<>(list); return new PageInfo<>(list);
...@@ -72,11 +108,75 @@ public class OpereportService extends AbstractCommonService { ...@@ -72,11 +108,75 @@ public class OpereportService extends AbstractCommonService {
setOrgCheckedAuth(search); setOrgCheckedAuth(search);
StopWatch sw = new StopWatch();
sw.start("report deviceExport task1");
List<ReportDeviceExport> list = vehicleDeviceMapper.exportReportDevice(search); List<ReportDeviceExport> list = vehicleDeviceMapper.exportReportDevice(search);
sw.stop();
sw.start("report deviceExport task2");
try {
getDeviceLocations(list);
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
sw.stop();
sw.start("report deviceExport task3");
organizationApiService.drawAllLevel(list); organizationApiService.drawAllLevel(list);
sw.stop();
log.info("report deviceExport任务耗时概览:{},总耗时:{}秒", sw.prettyPrint(), sw.getTotalTimeSeconds());
return list; return list;
} }
public void getDeviceLocations(List<ReportDeviceExport> dataList) throws InterruptedException, ExecutionException {
if (CollectionUtils.isEmpty(dataList)) {
return;
}
List<String> snList = dataList.stream().map(ReportDeviceExport::getSns).collect(Collectors.toList());
//切分成一个list去请求
List<List<String>> partList = Lists.partition(snList, 1000);
CompletableFuture<Map<String, GpsBsData>>[] futures = new CompletableFuture[partList.size()];
//异步请求
for (int i = 0; i < partList.size(); i++) {
List<String> subSnList = partList.get(i);
log.info("总处理条数:{},总处理批次:{},开始处理第{}批({})", dataList.size(), partList.size(), i, subSnList.size());
CompletableFuture<Map<String, GpsBsData>> completableFuture = CompletableFuture.supplyAsync(() -> remoteGpsBsService.getLastGpsBsBySns(subSnList), threadPoolTaskExecutor)
.exceptionally(Error -> Maps.newHashMap());
futures[i] = completableFuture;
}
// List列表转成CompletableFuture的Array数组,使其可以作为allOf()的参数
// 使用join()方法使得主线程阻塞,并等待所有并行线程完成
CompletableFuture.allOf(futures).join();
Map<String, GpsBsData> gpsBsDataMap = Maps.newHashMap();
//异步结果
for (CompletableFuture<Map<String, GpsBsData>> item : futures) {
Map<String, GpsBsData> map = item.get();
gpsBsDataMap.putAll(map);
}
dataList.forEach(rdd -> {
GpsBsData gpsBsData = gpsBsDataMap.get(rdd.getSns());
if (gpsBsData != null) {
if (gpsBsData.getGpsLocation() != null) {
rdd.setGpsTime(gpsBsData.getGpsLocation().getDateTime());
rdd.setGpsAddress(gpsBsData.getGpsLocation().getAddress());
} else if (gpsBsData.getBsLocation() != null) {
rdd.setGpsTime(gpsBsData.getBsLocation().getDateTime());
rdd.setGpsAddress(gpsBsData.getBsLocation().getAddress());
}
}
});
}
} }
...@@ -5,23 +5,23 @@ ...@@ -5,23 +5,23 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="vehicle_id" jdbcType="INTEGER" property="vehicleId" /> <result column="vehicle_id" jdbcType="INTEGER" property="vehicleId"/>
<result column="sn" jdbcType="VARCHAR" property="sn" /> <result column="sn" jdbcType="VARCHAR" property="sn"/>
<result column="bind_status" jdbcType="TINYINT" property="bindStatus" /> <result column="bind_status" jdbcType="TINYINT" property="bindStatus"/>
<result column="trial_type" jdbcType="TINYINT" property="trialType" /> <result column="trial_type" jdbcType="TINYINT" property="trialType"/>
<result column="his_type" jdbcType="TINYINT" property="hisType" /> <result column="his_type" jdbcType="TINYINT" property="hisType"/>
<result column="wire_type" jdbcType="TINYINT" property="wireType" /> <result column="wire_type" jdbcType="TINYINT" property="wireType"/>
<result column="active_location_date" jdbcType="TIMESTAMP" property="activeLocationDate" /> <result column="active_location_date" jdbcType="TIMESTAMP" property="activeLocationDate"/>
<result column="active_location_lng" jdbcType="VARCHAR" property="activeLocationLng" /> <result column="active_location_lng" jdbcType="VARCHAR" property="activeLocationLng"/>
<result column="active_location_lat" jdbcType="VARCHAR" property="activeLocationLat" /> <result column="active_location_lat" jdbcType="VARCHAR" property="activeLocationLat"/>
<result column="active_location_type" jdbcType="TINYINT" property="activeLocationType" /> <result column="active_location_type" jdbcType="TINYINT" property="activeLocationType"/>
<result column="active_location_address" jdbcType="VARCHAR" property="activeLocationAddress" /> <result column="active_location_address" jdbcType="VARCHAR" property="activeLocationAddress"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" /> <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy" /> <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" /> <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy" /> <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
</resultMap> </resultMap>
<resultMap id="VehicleDeviceWorkOrderResultMap" type="cn.com.glsx.admin.modules.entity.VehicleDeviceWorkOrder"> <resultMap id="VehicleDeviceWorkOrderResultMap" type="cn.com.glsx.admin.modules.entity.VehicleDeviceWorkOrder">
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
tv.vin, tv.owner_name, tv.vin, tv.owner_name,
tw.partner_order_no, tw.shop_name tw.partner_order_no, tw.shop_name
--> -->
<result column="sn" jdbcType="VARCHAR" property="sn" /> <result column="sn" jdbcType="VARCHAR" property="sn"/>
<result column="vin" jdbcType="VARCHAR" property="vin" /> <result column="vin" jdbcType="VARCHAR" property="vin"/>
<result column="owner_name" jdbcType="VARCHAR" property="ownerName" /> <result column="owner_name" jdbcType="VARCHAR" property="ownerName"/>
<result column="partner_order_no" jdbcType="VARCHAR" property="workOrderNo" /> <result column="partner_order_no" jdbcType="VARCHAR" property="workOrderNo"/>
<result column="shop_name" jdbcType="VARCHAR" property="shopName" /> <result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
</sql> </sql>
<resultMap id="activeNumberMap" type="HashMap"> <resultMap id="activeNumberMap" type="HashMap">
<result column="allActiveNumber" jdbcType="INTEGER" property="allActiveNumber" /> <result column="allActiveNumber" jdbcType="INTEGER" property="allActiveNumber"/>
<result column="activeNumForToday" jdbcType="VARCHAR" property="activeNumForToday" /> <result column="activeNumForToday" jdbcType="VARCHAR" property="activeNumForToday"/>
</resultMap> </resultMap>
<sql id="common_where_if_condition"> <sql id="common_where_if_condition">
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<select id="selectBySnAndBindStatus" resultMap="BaseResultMap"> <select id="selectBySnAndBindStatus" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_vehicle_device tvd from t_vehicle_device tvd
where tvd.del_flag = 0 where tvd.del_flag = 0
and tvd.sn = #{sn} and tvd.sn = #{sn}
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<select id="selectBindDeviceByVehicleId" resultMap="BaseResultMap"> <select id="selectBindDeviceByVehicleId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_vehicle_device tvd from t_vehicle_device tvd
where tvd.del_flag = 0 where tvd.del_flag = 0
and tvd.vehicle_id = #{vehicleId} and tvd.vehicle_id = #{vehicleId}
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<select id="selectAndBindDeviceByVehicleId" resultMap="BaseResultMap"> <select id="selectAndBindDeviceByVehicleId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_vehicle_device tvd from t_vehicle_device tvd
where tvd.bind_status = 1 where tvd.bind_status = 1
and tvd.vehicle_id = #{vehicleId} and tvd.vehicle_id = #{vehicleId}
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<select id="selectVehicleDeviceByUserId" resultMap="BaseResultMap"> <select id="selectVehicleDeviceByUserId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_vehicle_device tvd from t_vehicle_device tvd
where tvd.del_flag = 0 where tvd.del_flag = 0
and bind_status = 1 and bind_status = 1
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<select id="getVehicleDeviceByVehicleAndSn" resultMap="BaseResultMap"> <select id="getVehicleDeviceByVehicleAndSn" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from t_vehicle_device tvd from t_vehicle_device tvd
where tvd.sn=#{sn} where tvd.sn=#{sn}
and tvd.vehicle_id=#{vehicleId} and tvd.vehicle_id=#{vehicleId}
...@@ -193,7 +193,24 @@ ...@@ -193,7 +193,24 @@
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and find_in_set(tv.created_by,#{checkedUserIdsStr})
</if>
<if test="activateBeginTime != null and activateBeginTime != '' and activateEndTime != null and activateEndTime != ''">
and DATE_FORMAT(tv.created_date,'%Y-%m-%d') between #{activateBeginTime} and #{activateEndTime}
</if>
<if test="gpsBeginTime != null and gpsBeginTime != '' and gpsEndTime != null and gpsEndTime != ''">
and (DATE_FORMAT(tdl.last_gps_time,'%Y-%m-%d') between #{gpsEndTime} and #{gpsEndTime} or DATE_FORMAT(tdl.last_bs_time,'%Y-%m-%d') between #{gpsEndTime} and
#{gpsEndTime})
</if>
<if test="term != null and term !=''">
and(
tv.owner_name like '%${term}%'
or tv.vin like '%${term}%'
or tvd.sn like '%${term}%'
or tw.partner_order_no like '%${term}%'
)
</if>
order by tv.created_date desc, vehicleId, tvd.id order by tv.created_date desc, vehicleId, tvd.id
</select> </select>
...@@ -219,7 +236,24 @@ ...@@ -219,7 +236,24 @@
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and find_in_set(tv.created_by,#{checkedUserIdsStr})
</if>
<if test="activateBeginTime != null and activateBeginTime != '' and activateEndTime != null and activateEndTime != ''">
and DATE_FORMAT(tv.created_date,'%Y-%m-%d') between #{activateBeginTime} and #{activateEndTime}
</if>
<if test="gpsBeginTime != null and gpsBeginTime != '' and gpsEndTime != null and gpsEndTime != ''">
and (DATE_FORMAT(tdl.last_gps_time,'%Y-%m-%d') between #{gpsEndTime} and #{gpsEndTime} or DATE_FORMAT(tdl.last_bs_time,'%Y-%m-%d') between #{gpsEndTime} and
#{gpsEndTime})
</if>
<if test="term != null and term !=''">
and(
tv.owner_name like '%${term}%'
or tv.vin like '%${term}%'
or tvd.sn like '%${term}%'
or tw.partner_order_no like '%${term}%'
)
</if>
order by tv.created_date desc, vehicleId, tvd.id order by tv.created_date desc, vehicleId, tvd.id
</select> </select>
......
...@@ -1272,8 +1272,23 @@ ...@@ -1272,8 +1272,23 @@
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.del_flag = 0 and tvd.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and find_in_set(tv.created_by,#{checkedUserIdsStr})
</if>
<if test="activateBeginTime != null and activateBeginTime != '' and activateEndTime != null and activateEndTime != ''">
and DATE_FORMAT(tv.created_date,'%Y-%m-%d') between #{activateBeginTime} and #{activateEndTime}
</if>
<if test="orderBeginTime != null and orderBeginTime != '' and orderEndTime != null and orderEndTime != ''">
and DATE_FORMAT(tw.created_date,'%Y-%m-%d') between #{orderBeginTime} and #{orderEndTime}
</if>
<if test="term != null and term !=''">
and(
tv.owner_name like '%${term}%'
or tv.vin like '%${term}%'
or tvd.sn like '%${term}%'
or tw.partner_order_no like '%${term}%'
)
</if>
group by tv.id group by tv.id
order by tv.created_date desc order by tv.created_date desc
</select> </select>
...@@ -1302,8 +1317,23 @@ ...@@ -1302,8 +1317,23 @@
where tv.del_flag = 0 where tv.del_flag = 0
and tvd.del_flag = 0 and tvd.del_flag = 0
and tvd.bind_status = 1 and tvd.bind_status = 1
<if test="checkedUserIdsStr != null and checkedUserIdsStr !=''">
and find_in_set(tv.created_by,#{checkedUserIdsStr})
</if>
<if test="activateBeginTime != null and activateBeginTime != '' and activateEndTime != null and activateEndTime != ''">
and DATE_FORMAT(tv.created_date,'%Y-%m-%d') between #{activateBeginTime} and #{activateEndTime}
</if>
<if test="orderBeginTime != null and orderBeginTime != '' and orderEndTime != null and orderEndTime != ''">
and DATE_FORMAT(tw.created_date,'%Y-%m-%d') between #{orderBeginTime} and #{orderEndTime}
</if>
<if test="term != null and term !=''">
and(
tv.owner_name like '%${term}%'
or tv.vin like '%${term}%'
or tvd.sn like '%${term}%'
or tw.partner_order_no like '%${term}%'
)
</if>
group by tv.id group by tv.id
order by tv.created_date desc order by tv.created_date desc
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!