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("物联编码重复");
}
......
......@@ -37,6 +37,8 @@ public interface CarMapper extends BaseMapper<Car> {
List<String> getIotCodeList(@Param("id") String id);
Car getCarsByIotCode(@Param("iotCode") String iotCode);
Car getCarsByIotCodeExcludeCarId(@Param("iotCode") String iotCode, @Param("carId") Long carId);
List<CarIndexVo> getCarsInfoByOrgCode(@Param("orgCode") String orgCode);
......
......@@ -247,6 +247,18 @@
AND
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">
......
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