Commit 18cd7f66 authored by hanbing's avatar hanbing

系统管理-设备管理-信号机管理-删除

parent cf43a81f
......@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.vo.systemadmin.*;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -54,12 +53,12 @@ public class CrossInfoController {
return jsonViewObject.success();
}
// @ApiOperation(value = "接口删除", notes = "接口删除", consumes = MediaType.APPLICATION_JSON)
// @PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
// public JsonViewObject delete(@RequestBody DeleteListInVO inVO) {
// manufacturerApiInfoService.delete(inVO);
// JsonViewObject jsonViewObject = JsonViewObject.newInstance();
//
// return jsonViewObject.success();
// }
@ApiOperation(value = "信号机删除", notes = "信号机删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteByStringIdListInVO inVO) {
crossInfoService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success();
}
}
......@@ -8,11 +8,10 @@ import io.swagger.annotations.ApiResponses;
import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -60,7 +59,7 @@ public class ManufacturerApiController {
@ApiOperation(value = "接口删除", notes = "接口删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteListInVO inVO) {
public JsonViewObject delete(@RequestBody DeleteByIntegerIdListInVO inVO) {
manufacturerApiInfoService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
......@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiResponses;
import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -58,7 +58,7 @@ public class ManufacturerController {
@ApiOperation(value = "厂商删除", notes = "厂商删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteListInVO inVO) {
public JsonViewObject delete(@RequestBody DeleteByIntegerIdListInVO inVO) {
manufacturerService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
......@@ -30,4 +30,6 @@ public interface CrossInfoMapper {
void insertOne(CrossInfoPO crossInfoPO);
void updateOne(CrossInfoPO crossInfoPO);
void deleteBatch(@Param("ids") List<String> ids);
}
......@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import net.wanji.utc.vo.systemadmin.CrossInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO;
import net.wanji.utc.vo.systemadmin.CrossInfoListOutVO;
import net.wanji.utc.vo.systemadmin.DeleteByStringIdListInVO;
/**
* @author Kent HAN
......@@ -13,4 +14,6 @@ public interface CrossInfoService {
PageInfo<CrossInfoListOutVO> list(CrossInfoListInVO crossInfoListInVO);
void insertOrUpdate(CrossInfoInsertOrUpdateInVO inVO);
void delete(DeleteByStringIdListInVO inVO);
}
......@@ -2,7 +2,7 @@ package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO;
......@@ -15,5 +15,5 @@ public interface ManufacturerApiInfoService {
void insertOrUpdate(ManufacturerApiInfoInsertOrUpdateInVO inVO);
void delete(DeleteListInVO inVO);
void delete(DeleteByIntegerIdListInVO inVO);
}
......@@ -2,7 +2,7 @@ package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
......@@ -15,5 +15,5 @@ public interface ManufacturerService {
void insertOrUpdate(ManufacturerInsertOrUpdateInVO inVO);
void delete(DeleteListInVO inVO);
void delete(DeleteByIntegerIdListInVO inVO);
}
......@@ -15,6 +15,7 @@ import net.wanji.utc.util.PageUtils;
import net.wanji.utc.vo.systemadmin.CrossInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO;
import net.wanji.utc.vo.systemadmin.CrossInfoListOutVO;
import net.wanji.utc.vo.systemadmin.DeleteByStringIdListInVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -105,4 +106,10 @@ public class CrossInfoServiceImpl implements CrossInfoService {
crossInfoMapper.updateOne(crossInfoPO);
}
}
@Override
public void delete(DeleteByStringIdListInVO inVO) {
List<String> ids = inVO.getIds();
crossInfoMapper.deleteBatch(ids);
}
}
......@@ -7,7 +7,7 @@ import net.wanji.utc.mapper.ManufacturerApiInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO;
import org.springframework.beans.BeanUtils;
......@@ -76,7 +76,7 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
}
@Override
public void delete(DeleteListInVO inVO) {
public void delete(DeleteByIntegerIdListInVO inVO) {
List<Integer> ids = inVO.getIds();
manufacturerApiInfoMapper.deleteBatch(ids);
}
......
......@@ -5,7 +5,7 @@ import com.github.pagehelper.PageInfo;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.BeanUtils;
......@@ -51,7 +51,7 @@ public class ManufacturerServiceImpl implements ManufacturerService {
}
@Override
public void delete(DeleteListInVO inVO) {
public void delete(DeleteByIntegerIdListInVO inVO) {
List<Integer> ids = inVO.getIds();
manufacturerInfoMapper.deleteBatch(ids);
}
......
......@@ -11,8 +11,8 @@ import java.util.List;
* @date 2022/11/24 10:10
*/
@Data
@ApiModel(value = "DeleteListInVO", description = "厂商或接口删除输入参数")
public class DeleteListInVO {
@ApiModel(value = "DeleteByIntegerIdListInVO", description = "厂商或接口删除输入参数")
public class DeleteByIntegerIdListInVO {
/** 厂商或接口ID列表 */
@ApiModelProperty(value = "厂商或接口ID列表",notes = "")
private List<Integer> ids ;
......
package net.wanji.utc.vo.systemadmin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/11/24 10:10
*/
@Data
@ApiModel(value = "DeleteByStringIdListInVO", description = "信号机删除输入参数")
public class DeleteByStringIdListInVO {
/** 信号机ID列表 */
@ApiModelProperty(value = "信号机ID列表",notes = "")
private List<String> ids ;
}
......@@ -64,6 +64,14 @@
where id = #{id}
</update>
<delete id="deleteBatch">
delete from t_cross_info
where id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
select
id,name,code,manufacturer_id,ip,port,location,version,model,install_time,gmt_create,gmt_modified
......
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