Commit cabb850f authored by H2T's avatar H2T

风险管控措施页面接口修改

parent b4d4652c
...@@ -713,14 +713,23 @@ public class InputItemController extends AbstractBaseController { ...@@ -713,14 +713,23 @@ public class InputItemController extends AbstractBaseController {
throw new BadRequest("适用类型至少需选择一项"); throw new BadRequest("适用类型至少需选择一项");
} }
} }
if (StringUtil.isNotEmpty(param.getId()) && param.getId() != 0) {
if (inputItemDao.findByItemNoAndId(param.getItemNo(),param.getId()) > 0) {
throw new BadRequest("该编号已存在,请重新输入");
}
if (inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) { if (inputItemDao.findByItemNameAndId(param.getName(), param.getId()) > 0) {
throw new BadRequest("该名称已存在,请重新输入");
}
} else {
if (inputItemDao.findByItemNo(param.getItemNo()) > 0) {
throw new BadRequest("该编号已存在,请重新输入"); throw new BadRequest("该编号已存在,请重新输入");
} }
if (inputItemDao.findByItemName(param.getName(),param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) { if (inputItemDao.findByItemName(param.getName()) > 0) {
throw new BadRequest("该名称已存在,请重新输入"); throw new BadRequest("该名称已存在,请重新输入");
} }
}
//如果为1则为否,顺应机场逻辑 //如果为1则为否,顺应机场逻辑
/* param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType()); /* param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
......
...@@ -35,10 +35,16 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> { ...@@ -35,10 +35,16 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "delete * from p_input_item where is not null and is_delete =0", nativeQuery = true) @Query(value = "delete * from p_input_item where is not null and is_delete =0", nativeQuery = true)
void deleteAllByEquipmentNameIsNotNull(); void deleteAllByEquipmentNameIsNotNull();
@Query(value = "select count(1) from p_input_item where item_no = :itemNo and is_delete = 0 and id != :id", nativeQuery = true) @Query(value = "select count(1) from p_input_item where item_no = :itemNo and is_delete = 0 ", nativeQuery = true)
int findByItemNo(@Param("itemNo") String itemNo, @Param("id") String id); int findByItemNo(@Param("itemNo") String itemNo);
@Query(value = "select count(1) from p_input_item where name = :name and is_delete = 0", nativeQuery = true)
int findByItemName(@Param("name") String name);
@Query(value = "select count(1) from p_input_item where item_no = :itemNo and is_delete = 0 and id != :id ", nativeQuery = true)
int findByItemNoAndId(@Param("itemNo") String itemNo,@Param("id")long id);
@Query(value = "select count(1) from p_input_item where name = :name and is_delete = 0 and id != :id", nativeQuery = true) @Query(value = "select count(1) from p_input_item where name = :name and is_delete = 0 and id != :id", nativeQuery = true)
int findByItemName(@Param("name") String name,@Param("id")String id); int findByItemNameAndId(@Param("name") String name,@Param("id")long id);
} }
...@@ -31,7 +31,7 @@ mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl ...@@ -31,7 +31,7 @@ mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
equip.fegin.name=AMOS-EQUIPMANAGE equip.fegin.name=AMOS-EQUIPMANAGE
equip.fegin.prefix=/equip equip.fegin.prefix=/equip
input.custom.prefix = QYZD input.custom.prefix =
input.statute.prefix = FG input.statute.prefix = FG
......
...@@ -131,11 +131,16 @@ ...@@ -131,11 +131,16 @@
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<delete id="deleteReleInputItem" > <delete id="deleteReleInputItem">
delete b from p_point_inputitem a,p_route_point_item b where a.id = b.point_input_item_id and a.input_item_id in DELETE FROM p_route_point_item
WHERE point_input_item_id IN (
SELECT ID
FROM p_point_inputitem
WHERE input_item_id IN
<foreach item="Id" collection="array" index="index" open="(" separator="," close=")"> <foreach item="Id" collection="array" index="index" open="(" separator="," close=")">
#{Id} #{Id}
</foreach> </foreach>
);
</delete> </delete>
<select id="queryRouteListByOrgCode" resultType="Map"> <select id="queryRouteListByOrgCode" resultType="Map">
SELECT temp.* FROM ( SELECT temp.* FROM (
......
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