Commit a9e6b997 authored by maoying's avatar maoying

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

parent 66a7ad19
......@@ -315,7 +315,7 @@ public class CarController extends AbstractBaseController {
if(car.getIotCode()!=null){
Car ar= carMapper.getCarsByIotCode(car.getIotCode());
Car ar= carMapper.getCarsByIotCodeExcludeCarId(car.getIotCode(),car.getId());
if(ar!=null){
throw new BadRequest("物联编码重复");
}
......
......@@ -38,6 +38,8 @@ public interface CarMapper extends BaseMapper<Car> {
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> getCarsIotInfoByIotCode(@Param("iotCode") String iotCode);
......
......@@ -248,6 +248,18 @@
wc.iot_code = #{iotCode}
</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
......
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