Commit d51891c1 authored by chenzhao's avatar chenzhao

增加逻辑 绑定巡查点是过滤没有巡查对象的

parent b242549c
......@@ -28,6 +28,12 @@ public class Route extends BasicEntity {
*/
private String boss;
/**
* 巡查点下是否存在巡查对象
* */
private String isExist;
/**
* 路线3维坐标
*/
......@@ -90,6 +96,15 @@ public class Route extends BasicEntity {
*/
@Column(name="boss_name")
private String bossName;
public String getIsExist() {
return isExist;
}
public void setIsExist(String isExist) {
this.isExist = isExist;
}
//所属单位code
@Column(name="biz_org_code")
private String bizOrgCode;
......
......@@ -145,7 +145,8 @@ public class RouteController extends AbstractBaseController {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
//2.查询
List<Route> routeList = routeService.queryRouteList(orgCode);
List<Route> routeList = routeService.queryRouteListNew(orgCode);
routeList.stream().filter(e->e.getIsExist().equals("true"));
return CommonResponseUtil.success(routeList);
} catch (Exception e) {
log.error(e.getMessage(), e);
......
......@@ -106,4 +106,6 @@ public interface RouteMapper extends BaseMapper {
List<HashMap<String, Object>> queryRoutePointItemByCondition(RoutePointInputItemRequest request);
List<Route> queryRoutesByOrgCode(@Param("orgCode") String orgCode);
List<Route> queryRoutesByOrgCodeNew(@Param("orgCode") String orgCode);
}
......@@ -691,4 +691,10 @@ public class RouteServiceImpl implements IRouteService {
// TODO Auto-generated method stub
return routeMapper.queryRoutesByOrgCode(orgCode);
}
@Override
public List<Route> queryRouteListNew(String orgCode) {
// TODO Auto-generated method stub
return routeMapper.queryRoutesByOrgCodeNew(orgCode);
}
}
......@@ -210,4 +210,5 @@ public interface IRouteService {
*/
boolean existRouteName(String orgCode, String name);
List<Route> queryRouteListNew(String orgCode);
}
......@@ -444,4 +444,22 @@
<select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route">
SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
</select>
<!--如果查询的点下没有检查项 返回一个标识 -->
<select id="queryRoutesByOrgCodeNew" resultType="com.yeejoin.amos.patrol.dao.entity.Route">
SELECT
r.* ,
IF(prp.id is null,'false','true') as isExist
FROM
p_route r
left join p_route_point prp on prp.route_id = r.id
left join p_route_point_item prpi on prpi.route_point_id = prp.id
WHERE
r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
GROUP BY r.id
</select>
</mapper>
\ No newline at end of file
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