Commit 12a80fc7 authored by zhangsen's avatar zhangsen

巡检bug1104

parent 245679b3
......@@ -13,7 +13,7 @@ import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.component.robot.BadRequest;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......
......@@ -1515,13 +1515,13 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.failure("责任人不能为空");
}
if (!ObjectUtils.isEmpty(pointNewVo.getName())) {
List<Point> list = iPointDao.findByName(pointNewVo.getName());
List<Point> list = iPointDao.findByName(pointNewVo.getName(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该名称巡检点已存在");
}
}
if (!ObjectUtils.isEmpty(pointNewVo.getName())) {
List<Point> list = iPointDao.findByNo(pointNewVo.getPointNo());
List<Point> list = iPointDao.findByNo(pointNewVo.getPointNo(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该编号已存在");
}
......
......@@ -25,11 +25,11 @@ public interface IPointDao extends BaseDao<Point, Long> {
@Query(value = "select * from p_point where original_id in ?1 and is_delete =0", nativeQuery = true)
List<Point> listByOriginalIds(List<String> originalIds);
@Query(value = "select * from p_point where point_no = (?1) and is_delete =0", nativeQuery = true)
List<Point> findByNo(String pointNo);
@Query(value = "select * from p_point where point_no = (?1) and is_delete =0 and if(?2 is null, 1 = 1 , id = ?2)", nativeQuery = true)
List<Point> findByNo(String pointNo, String id);
@Query(value = "select * from p_point where name = (?1) and is_delete =0", nativeQuery = true)
List<Point> findByName(String name);
@Query(value = "select * from p_point where name = (?1) and is_delete =0 and if(?2 is null, 1 = 1 , id = ?2)", nativeQuery = true)
List<Point> findByName(String name, String id);
Optional<Point> findById(Long id);
......
......@@ -70,6 +70,16 @@ public class PlanTaskPageParam extends CommonPageable {
* */
private String bizOrgCode;
private String searchDay;
public String getSearchDay() {
return searchDay;
}
public void setSearchDay(String searchDay) {
this.searchDay = searchDay;
}
public String getBizOrgCode() {
return bizOrgCode;
}
......
......@@ -571,7 +571,7 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
iRoutePointItemDao.saveAll(routePointList);
}
@Transactional(rollbackFor = Exception.class)
@Transactional
public void updateRoutePointInputItemNew(Long routeId, Long pointId, List<Long> inputItemIds) {
Long[] pointIds = {pointId};
List<RoutePoint> oldRoutePointList = iRoutePointDao.queryRoutePoint(routeId, pointIds);
......
......@@ -42,7 +42,9 @@
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="bizOrgCode!=null"> and a.org_Code like concat (#{bizOrgCode},"%")</if>
<if test="searchDay!=null and searchDay != '' searchDay == 1">
and a.`check_date` = curdate()
</if>
</where>
order by b.id) t
......@@ -123,6 +125,9 @@
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="searchDay!=null and searchDay != '' searchDay == 1">
and a.`check_date` = curdate()
</if>
</where>
order by b.id DESC
<choose>
......
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