车辆修改

This commit is contained in:
GUO 2024-05-27 20:53:36 +08:00
parent 7690223abc
commit c026b575e4
5 changed files with 25 additions and 36 deletions

View File

@ -13,4 +13,5 @@ public interface Cts {
String PROJECT_SN = "projectSn";
String EXPIRED = "expired";
String ID = "id";
String TODAY = "today";
}

View File

@ -70,7 +70,6 @@ public class CarPassRecordController {
@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) {

View File

@ -1,19 +1,18 @@
package com.zhgd.xmgl.modules.car.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.DataScope;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.car.entity.CarPassRecord;
import com.zhgd.xmgl.modules.car.entity.vo.TodayOutInNumber;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.DataScope;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.car.entity.vo.TodayOutInNumber;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.car.entity.CarPassRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.data.redis.hash.HashMapper;
/**
* @Description: 车辆通行记录
* @author pds
@ -27,8 +26,6 @@ public interface CarPassRecordMapper extends BaseMapper<CarPassRecord> {
List<EntityMap> getCarPassRecordListByType(Map<String, Object> map);
List<CarPassRecord> getCarPassRecordList(Map<String, Object> map);
int getTotalCarNumByCameraId(Map<String, Object> map);
int getLsCarNumTotalByCameraId(Map<String, Object> map);
@ -40,6 +37,7 @@ public interface CarPassRecordMapper extends BaseMapper<CarPassRecord> {
List<EntityMap> selectCarPassPage(Page<EntityMap> page, @Param("param") Map<String, Object> map);
List<CarPassRecord> selectProjectCarPassPageList(Page<CarPassRecord> page, @Param("param") Map<String, Object> map);
List<CarPassRecord> selectProjectCarPassPageList(@Param("param") Map<String, Object> map);
String selectCarEnterTime(@Param("projectSn") String projectSn, @Param("carNumber") String carNumber);

View File

@ -20,24 +20,6 @@
and a.pass_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
ORDER BY a.pass_time DESC
</select>
<select id="getCarPassRecordList" resultType="com.zhgd.xmgl.modules.car.entity.CarPassRecord">
SELECT a.*, b.is_black,
ifnull(b.car_module_type,4) as carModuleType
FROM car_pass_record a
LEFT JOIN car_info b ON (a.project_sn = b.project_sn AND a.car_number = b.car_number)
WHERE a.project_sn = #{projectSn}
<if test="cameraId != null and cameraId != ''">
AND a.camera_id = #{cameraId}
</if>
<if test="type == '1'.toString()">
and b.id is null
</if>
<if test="type == '2'.toString()">
and b.id is not null
</if>
and a.pass_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
ORDER BY a.pass_time DESC
</select>
<select id="getTotalCarNumByCameraId" resultType="java.lang.Integer" parameterType="map">
SELECT COUNT(DISTINCT a.car_number)
FROM car_pass_record a
@ -163,11 +145,18 @@
else 3 end) car_type,
ifnull(b.car_module_type,4) as carModuleType,
b.enterprise_name,
b.driver_worker_name
b.driver_worker_name,
b.is_black
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.queryType == 'today'.toString()">
and t.pass_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
</if>
<if test="param.cameraId != null and param.cameraId != ''">
AND t.camera_id = #{param.cameraId}
</if>
<if test="param.carModuleType != null and param.carModuleType != '' and param.carModuleType != '4'.toString()">
and b.car_module_type = #{param.carModuleType}
</if>
@ -194,12 +183,12 @@
<if test="param.carNumber != null and param.carNumber != ''">
and t.car_number like CONCAT(CONCAT('%', #{param.carNumber}), '%')
</if>
<if test="param.type != null">
and t.type = #{param.type}
</if>
<if test="param.timeType == '1'.toString()">
and t.pass_time >= current_date
</if>
<if test="param.type != null">
and t.type = #{param.type}
</if>
order by t.pass_time desc
</select>
<select id="selectCarEnterTime" resultType="java.lang.String">

View File

@ -13,6 +13,7 @@ import com.zhgd.jeecg.common.util.HuaWeiMessageUtils;
import com.zhgd.mqtt.server.IMqttSender;
import com.zhgd.xmgl.async.AsyncCar;
import com.zhgd.xmgl.async.AsyncSendAttendance;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.basicdata.entity.Notice;
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
@ -368,7 +369,8 @@ public class CarPassRecordServiceImpl extends ServiceImpl<CarPassRecordMapper, C
@Override
public List<CarPassRecord> getCarPassRecordList(Map<String, Object> map) {
List<CarPassRecord> carPassRecordList = carPassRecordMapper.getCarPassRecordList(map);
map.put(Cts.QUERY_TYPE, Cts.TODAY);
List<CarPassRecord> carPassRecordList = carPassRecordMapper.selectProjectCarPassPageList(map);
for (CarPassRecord cpr : carPassRecordList) {
//
if (Objects.equals(cpr.getType(), 0) && cpr.getIsOpen().equals(1)) {