新增车辆、查询车辆问题修改
parent
9f1ef44b6a
commit
eef7f575fe
|
|
@ -55,6 +55,11 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(BizTruckEntity bizTruckEntity) {
|
||||
bizTruckEntity.setAuditStatus(AuditStatus.DaiShenHe);
|
||||
String licensePlate = bizTruckEntity.getLicensePlate();
|
||||
boolean exists = this.exists(Wrappers.lambdaQuery(BizTruckEntity.class).eq(BizTruckEntity::getLicensePlate, licensePlate));
|
||||
if (exists) {
|
||||
throw Exceptions.exception("车牌号已存在:{}", licensePlate);
|
||||
}
|
||||
String gps = bizTruckEntity.getGps();
|
||||
if (StrUtil.isNotBlank(gps)) {
|
||||
long count = deviceLocalizerService.count(Wrappers.<DeviceLocalizerEntity>query().eq("terminal_id", gps));
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
c.last_time >= DATE_SUB(NOW(), INTERVAL 5 MINUTE) `online`
|
||||
FROM biz_truck a
|
||||
INNER JOIN biz_company b ON b.id = a.company_id
|
||||
INNER JOIN device_localizer c ON c.terminal_id = a.gps
|
||||
LEFT JOIN device_localizer c ON c.terminal_id = a.gps
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
c.last_time >= DATE_SUB(NOW(), INTERVAL 5 MINUTE) `online`
|
||||
FROM biz_truck a
|
||||
INNER JOIN biz_company b ON b.id = a.company_id
|
||||
INNER JOIN device_localizer c ON c.terminal_id = a.gps
|
||||
LEFT JOIN device_localizer c ON c.terminal_id = a.gps
|
||||
WHERE a.id = #{id} AND a.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue