Commit 91249096 authored by zhengjiawei's avatar zhengjiawei

bug

parent 62769d43
......@@ -165,7 +165,7 @@ public class RiskModelController extends BaseController {
public CommonResponse editFmea(@ApiParam(value = "Fmea模型对象", required = true) @RequestBody List<Fmea> params) {
try {
params.forEach(param -> {
int i = iFmeaDao.checkIdAndName(param.getRiskSourceId(), param.getRiskFactorsId());
int i = iFmeaDao.checkIdAndName(param.getRiskSourceId(), param.getRiskFactorsId(),param.getId());
if (i>0){
throw new YeeException("危险因素重复");
}
......
......@@ -49,6 +49,6 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
@Query(value = "select * from `f_fmea` where id in ?1",nativeQuery = true)
List<Fmea> findAllByRiskSourceIds(List<Long> ids);
@Query(value = "select count(1) from `f_fmea` where risk_source_id = ?1 and risk_factors_id = ?2",nativeQuery = true)
int checkIdAndName(Long sId,Long nId);
@Query(value = "select count(1) from `f_fmea` where risk_source_id = ?1 and risk_factors_id = ?2 and id != ?3",nativeQuery = true)
int checkIdAndName(Long sId,Long nId,Long id);
}
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