Commit a9e6b997 authored by maoying's avatar maoying

修改车辆编辑物联编码重复提示

parent 66a7ad19
...@@ -315,7 +315,7 @@ public class CarController extends AbstractBaseController { ...@@ -315,7 +315,7 @@ public class CarController extends AbstractBaseController {
if(car.getIotCode()!=null){ if(car.getIotCode()!=null){
Car ar= carMapper.getCarsByIotCode(car.getIotCode()); Car ar= carMapper.getCarsByIotCodeExcludeCarId(car.getIotCode(),car.getId());
if(ar!=null){ if(ar!=null){
throw new BadRequest("物联编码重复"); throw new BadRequest("物联编码重复");
} }
......
...@@ -38,6 +38,8 @@ public interface CarMapper extends BaseMapper<Car> { ...@@ -38,6 +38,8 @@ public interface CarMapper extends BaseMapper<Car> {
Car getCarsByIotCode(@Param("iotCode") String iotCode); Car getCarsByIotCode(@Param("iotCode") String iotCode);
Car getCarsByIotCodeExcludeCarId(@Param("iotCode") String iotCode, @Param("carId") Long carId);
List<CarIndexVo> getCarsInfoByOrgCode(@Param("orgCode") String orgCode); List<CarIndexVo> getCarsInfoByOrgCode(@Param("orgCode") String orgCode);
List<CarIndexVo> getCarsIotInfoByIotCode(@Param("iotCode") String iotCode); List<CarIndexVo> getCarsIotInfoByIotCode(@Param("iotCode") String iotCode);
......
...@@ -248,6 +248,18 @@ ...@@ -248,6 +248,18 @@
wc.iot_code = #{iotCode} wc.iot_code = #{iotCode}
</select> </select>
<select id="getCarsByIotCodeExcludeCarId" resultType="com.yeejoin.equipmanage.common.entity.Car">
SELECT
wc.car_num
FROM
wl_car wc
WHERE
wc.iot_code IS NOT NULL
AND
wc.iot_code = #{iotCode}
AND wc.id != #{carId}
</select>
<select id="getCarsInfoByOrgCode" resultMap="carIotInfoMap"> <select id="getCarsInfoByOrgCode" resultMap="carIotInfoMap">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment