车辆bug修改

This commit is contained in:
guoshengxiong 2024-05-27 14:49:44 +08:00
parent cdb12bc9e0
commit fd6ad14792
5 changed files with 79 additions and 52 deletions

View File

@ -44,6 +44,39 @@ public class CarPassRecordController {
public static Map<String, Object> openCarMap = new HashMap<>();
/**
* 分页列表查询
*
* @return
*/
@ApiOperation(value = "分页列表查询车辆通行记录信息", notes = "分页列表查询车辆通行记录信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "carType", value = "查询类型1白名单2黑名单3临时车辆", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "进出类型1为出 0为进", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "carNumber", value = "车牌号", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间时间格式2021-06-01", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间格式2021-06-01", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "timeType", value = "1今日2历史", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = {"/list", "/page"})
public Result<IPage<CarPassRecord>> queryPageList(@RequestBody Map<String, Object> map) {
return Result.success(carPassRecordService.selectProjectCarPassPageList(map));
}
@ApiOperation(value = "查询当日车辆通行记录列表", notes = "查询当日车辆通行记录列表", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "cameraId", value = "相机ID", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "类型1查询临时车通行记录2查询白名单车通行记录不传查所有", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/getCarPassRecordList")
public Result<List<CarPassRecord>> getCarPassRecordList(@RequestBody Map<String, Object> map) {
return Result.success(carPassRecordService.getCarPassRecordList(map));
}
/**
* 编辑
*
@ -81,39 +114,6 @@ public class CarPassRecordController {
return result;
}
/**
* 分页列表查询
*
* @return
*/
@ApiOperation(value = "分页列表查询车辆通行记录信息", notes = "分页列表查询车辆通行记录信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "carType", value = "查询类型1白名单2黑名单3临时车辆", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "进出类型1为出 0为进", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "carNumber", value = "车牌号", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间时间格式2021-06-01", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间格式2021-06-01", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "timeType", value = "1今日2历史", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = {"/list", "/page"})
public Result<IPage<CarPassRecord>> queryPageList(@RequestBody Map<String, Object> map) {
return Result.success(carPassRecordService.selectProjectCarPassPageList(map));
}
@ApiOperation(value = "查询当日车辆通行记录列表", notes = "查询当日车辆通行记录列表", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "cameraId", value = "相机ID", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "type", value = "类型1查询临时车通行记录2查询白名单车通行记录不传查所有", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/getCarPassRecordList")
public Result<List<CarPassRecord>> getCarPassRecordList(@RequestBody Map<String, Object> map) {
return Result.success(carPassRecordService.getCarPassRecordList(map));
}
@ApiOperation(value = "车辆通行记录统计", notes = "车辆通行记录统计", httpMethod = "POST")
@ApiImplicitParams({

View File

@ -100,7 +100,7 @@ public class CarInfo implements Serializable {
@ApiModelProperty(value = "报警推送人")
private java.lang.String alarmPushWorkerId;
@ApiModelProperty(value = "车辆类型1、固定车2、预约车辆临时3、外来车辆")
@ApiModelProperty(value = "车辆类型1、固定车2、预约车辆长期3、预约车辆临时")
private Integer carModuleType;
@ApiModelProperty(value = "预约开始时间")

View File

@ -121,4 +121,15 @@ public class CarPassRecord implements Serializable {
@ApiModelProperty(value = "车辆状态名称(未出场、已出场、已进场、未进场)")
@TableField(exist = false)
private java.lang.String vehicleStateName;
@TableField(exist = false)
@ApiModelProperty(value = "合作单位名称")
private java.lang.String enterpriseName;
@TableField(exist = false)
@ApiModelProperty(value = "姓名")
private java.lang.String driverWorkerName;
@TableField(exist = false)
@ApiModelProperty(value = "车辆类型1、固定车2、预约车辆长期3、预约车辆临时、4外来车辆")
private Integer carModuleType;
}

View File

@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.car.mapper.CarInfoMapper">
<select id="selectCarList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT if(t.car_module_type=1 or t.car_module_type=2,wi.id_card,t.outside_driver_id_card) as
outside_driver_id_card,
t.*,b.car_type_name,ei.enterprise_name
<sql id="all">
SELECT
if(t.car_module_type=1 or t.car_module_type=2,wi.id_card,t.outside_driver_id_card) as outsideDriverIdCard,
if(t.car_module_type=1 or t.car_module_type=2,wi.worker_name,t.driver_worker_name) as driverWorkerName,
t.*,
b.car_type_name,
ei.enterprise_name
FROM car_info t LEFT JOIN car_type b ON (t.car_type=b.id and t.project_sn=b.project_sn)
left join enterprise_info ei on ei.id=t.enterprise_id
left join worker_info wi on t.driver_worker_id = wi.id
left join worker_info wi on t.driver_worker_id = wi.id and t.car_module_type=1 or t.car_module_type=2
left join worker_info wi1 on wi1.id_card=t.outside_driver_id_card and t.car_module_type=3
WHERE t.project_sn=#{param.projectSn}
<if test="param.carNumber != null and param.carNumber != ''">
and t.car_number like CONCAT(CONCAT('%',#{param.carNumber}),'%')
@ -29,6 +32,10 @@
and t.send_success_status = #{param.sendSuccessStatus}
</if>
order by t.id desc
</sql>
<select id="selectCarList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
<include refid="all">
</include>
</select>
<select id="selectCarTypeCount" resultType="java.util.Map">
SELECT b.car_type_name carTypeName,COUNT(1) carTypeNum,

View File

@ -155,15 +155,24 @@
order by a.pass_time desc
</select>
<select id="selectProjectCarPassPageList" resultType="com.zhgd.xmgl.modules.car.entity.CarPassRecord">
select a.*,
select t.*,
(case
when b.id is not null AND b.is_black = 0 then 1
when b.id is not null AND b.is_black = 1 then 2
else 3 end) car_type
FROM car_pass_record a
LEFT JOIN car_info b ON (a.project_sn = b.project_sn AND a.car_number = b.car_number)
left join enterprise_info ei on ei.id=b.enterprise_id
where a.project_sn = #{param.projectSn}
else 3 end) car_type,
ifnull(b.car_module_type,4) as carModuleType,
b.enterprise_name,
b.driver_worker_name
FROM car_pass_record as t
left join (<include refid="com.zhgd.xmgl.modules.car.mapper.CarInfoMapper.all"/>) as b ON (t.project_sn =
b.project_sn AND t.car_number = b.car_number)
where t.project_sn = #{param.projectSn}
<if test="param.carModuleType != null and param.carModuleType != ''">
and b.car_module_type = #{param.carModuleType}
</if>
<if test="param.carModuleType == '4'.toString()">
and b.id is null
</if>
<if test="param.carType == '1'.toString()">
and b.id is not null
AND b.is_black = 0
@ -176,21 +185,21 @@
and b.id is null
</if>
<if test="param.startTime != null and param.startTime != ''">
AND a.pass_time &gt;= CONCAT(DATE_FORMAT(#{param.startTime}, '%Y-%m-%d'), ' 00:00:00')
AND t.pass_time &gt;= CONCAT(DATE_FORMAT(#{param.startTime}, '%Y-%m-%d'), ' 00:00:00')
</if>
<if test="param.endTime != null and param.endTime != ''">
AND a.pass_time &lt;= CONCAT(DATE_FORMAT(#{param.endTime}, '%Y-%m-%d'), ' 23:59:59')
AND t.pass_time &lt;= CONCAT(DATE_FORMAT(#{param.endTime}, '%Y-%m-%d'), ' 23:59:59')
</if>
<if test="param.carNumber != null and param.carNumber != ''">
and a.car_number like CONCAT(CONCAT('%', #{param.carNumber}), '%')
and t.car_number like CONCAT(CONCAT('%', #{param.carNumber}), '%')
</if>
<if test="param.type != null">
and a.type = #{param.type}
and t.type = #{param.type}
</if>
<if test="param.timeType == '1'.toString()">
and a.pass_time >= current_date
and t.pass_time >= current_date
</if>
order by a.pass_time desc
order by t.pass_time desc
</select>
<select id="selectCarEnterTime" resultType="java.lang.String">
select pass_time