Commit c0b2eab2 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_tzs_patrol' into develop_tzs_patrol

parents 57f4064d 848168e8
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.feign.TzsFeign;
import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam; import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam;
import com.yeejoin.amos.patrol.business.service.intfc.IPlanService; import com.yeejoin.amos.patrol.business.service.intfc.IPlanService;
import com.yeejoin.amos.patrol.business.util.CommonResponse; import com.yeejoin.amos.patrol.business.util.CommonResponse;
...@@ -39,6 +40,8 @@ public class PlanController extends AbstractBaseController { ...@@ -39,6 +40,8 @@ public class PlanController extends AbstractBaseController {
@Autowired @Autowired
JcsFeignClient jcsFeignClient; JcsFeignClient jcsFeignClient;
@Autowired
TzsFeign tzsFeign;
/** /**
* 新加接口 * 新加接口
...@@ -153,36 +156,38 @@ public class PlanController extends AbstractBaseController { ...@@ -153,36 +156,38 @@ public class PlanController extends AbstractBaseController {
String userId = getUserId(); String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> map = new HashMap<String, Object>(); HashMap<String, Object> map = new HashMap<>();
map.put("org_code", loginOrgCode); map.put("org_code", loginOrgCode);
map.put("user_id", userId); map.put("user_id", userId);
Map<String, String> deptMap = new HashMap<>(); // Map<String, String> deptMap = new HashMap<>();
Set<String> departmentIds = new HashSet<>(); // Set<String> departmentIds = new HashSet<>();
List<String> depts = Arrays.asList(param.getUserDept().split(",")); // List<String> groupIds = Arrays.asList(param.getUserGroupId().split(","));
depts.stream().forEach(dept -> { // depts.stream().forEach(dept -> {
deptMap.put(dept.substring(0, dept.indexOf("@")), dept.substring(dept.indexOf("@") + 1)); // deptMap.put(dept.substring(0, dept.indexOf("@")), dept.substring(dept.indexOf("@") + 1));
}); // });
for (String entry : deptMap.keySet()) { // for (String entry : deptMap.keySet()) {
String entryValue = deptMap.get(entry); // String entryValue = deptMap.get(entry);
departmentIds.add(entryValue); // departmentIds.add(entryValue);
} // }
StringBuffer departmentIdBuffer = new StringBuffer(); // StringBuffer departmentIdBuffer = new StringBuffer();
Iterator<String> it = departmentIds.iterator(); // Iterator<String> it = departmentIds.iterator();
while (it.hasNext()) { // while (it.hasNext()) {
departmentIdBuffer.append(it.next()).append(","); // departmentIdBuffer.append(it.next()).append(",");
} // }
if(departmentIds.size() > 0){ // if(departmentIds.size() > 0){
FeignClientResult<List<Map<String, Object>>> departmentModeldate= jcsFeignClient.selectByIdDeptList // FeignClientResult<List<Map<String, Object>>> departmentModeldate= jcsFeignClient.selectByIdDeptList
(departmentIdBuffer.toString().substring(0, departmentIdBuffer.toString().length() - 1)); // (departmentIdBuffer.toString().substring(0, departmentIdBuffer.toString().length() - 1));
List<Map<String, Object>> departmentModels = departmentModeldate.getResult(); // List<Map<String, Object>> departmentModels = departmentModeldate.getResult();
if(departmentModels!=null&&departmentModels.size()>0){ // if(departmentModels!=null&&departmentModels.size()>0){
Map<String, Object> mapj= departmentModels.get(0); // Map<String, Object> mapj= departmentModels.get(0);
param.setBizOrgCode(mapj.get("bizOrgCode").toString()); // param.setBizOrgCode(mapj.get("bizOrgCode").toString());
param.setBizOrgName(mapj.get("bizOrgName").toString()); // param.setBizOrgName(mapj.get("bizOrgName").toString());
} // }
} // }
param.setBizOrgCode(loginOrgCode);
param.setBizOrgName(getCompanyName(reginParams));
map.put("param", param); map.put("param", param);
Plan plan = planService.addPlan(map); Plan plan = planService.addPlan(map);
Object ob = plan != null ? ToJson.tojson(plan) : null; Object ob = plan != null ? ToJson.tojson(plan) : null;
......
...@@ -27,7 +27,7 @@ public interface IPlanDao extends BaseDao<Plan, Long> { ...@@ -27,7 +27,7 @@ public interface IPlanDao extends BaseDao<Plan, Long> {
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "UPDATE p_plan SET is_delete = 1,`status` = 1 WHERE id IN (?1)", nativeQuery = true) @Query(value = "UPDATE p_plan SET is_delete = 1,status = 1 WHERE id IN (?1)", nativeQuery = true)
void updatePlanDel(List<Long> ids); void updatePlanDel(List<Long> ids);
Plan findByOriginalId(String originalId); Plan findByOriginalId(String originalId);
......
...@@ -14,26 +14,26 @@ public interface IPlanTaskDetailDao extends BaseDao<PlanTaskDetail, Long> { ...@@ -14,26 +14,26 @@ public interface IPlanTaskDetailDao extends BaseDao<PlanTaskDetail, Long> {
@Transactional @Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true) @Query(value = "DELETE FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
void deletePlanTaskDetailByPointId(List<Long> pointIds); void deletePlanTaskDetailByPointId(List<Long> pointIds);
/** /**
* 根据任务id获取任务详情 * 根据任务id获取任务详情
* @param planTaskId * @param planTaskId
* @return * @return
*/ */
public List<PlanTaskDetail> findAllByTaskNo(Long planTaskId); public List<PlanTaskDetail> findAllByTaskNo(Long planTaskId);
/** /**
* 根据任务id及状态获取计划详情 * 根据任务id及状态获取计划详情
* @param planTaskId * @param planTaskId
* @return * @return
*/ */
public List<PlanTaskDetail> findAllByTaskNoAndStatus(Long planTaskId,String status); public List<PlanTaskDetail> findAllByTaskNoAndStatus(Long planTaskId,String status);
int countByIsFinish(int status); int countByIsFinish(int status);
int countByIsFinishAndTaskNo(int status,Long taskNo); int countByIsFinishAndTaskNo(int status,Long taskNo);
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE task_no IN (?1)", nativeQuery = true) @Query(value = "DELETE FROM p_plan_task_detail WHERE task_no IN (?1)", nativeQuery = true)
...@@ -42,6 +42,6 @@ public interface IPlanTaskDetailDao extends BaseDao<PlanTaskDetail, Long> { ...@@ -42,6 +42,6 @@ public interface IPlanTaskDetailDao extends BaseDao<PlanTaskDetail, Long> {
@Query(value = "select * FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true) @Query(value = "select * FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
List<PlanTaskDetail> findALLByPointId(Long pointId); List<PlanTaskDetail> findALLByPointId(Long pointId);
@Query(value = "select * FROM p_plan_task_detail WHERE id = ?1 AND `status` = ?2", nativeQuery = true) @Query(value = "select * FROM p_plan_task_detail WHERE id = ?1 AND status = ?2", nativeQuery = true)
List<PlanTaskDetail> findAllByIdAndStatus(long id, String status); List<PlanTaskDetail> findAllByIdAndStatus(long id, String status);
} }
...@@ -48,17 +48,17 @@ public class PlanServiceImpl implements IPlanService { ...@@ -48,17 +48,17 @@ public class PlanServiceImpl implements IPlanService {
public Plan addPlan(HashMap<String, Object> map) { public Plan addPlan(HashMap<String, Object> map) {
Plan param = (Plan) map.get("param"); Plan param = (Plan) map.get("param");
String userDept = param.getUserDept(); // String userGroupId = param.getUserGroupId();
String[] userDeptArr = userDept.split(","); // String[] userGroupIdArr = userGroupId.split(",");
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for(String str : userDeptArr) { // for(String str : userGroupIdArr) {
if(stringBuilder.length() > 0){ // if(stringBuilder.length() > 0){
stringBuilder.append("," + str.split("@")[0]); // stringBuilder.append(",").append(str.split("@")[0]);
}else{ // }else{
stringBuilder.append(str.split("@")[0]); // stringBuilder.append(str.split("@")[0]);
} // }
//
} // }
param.setUserId(stringBuilder.toString()); param.setUserId(stringBuilder.toString());
String org_code = map.get("org_code") == null ? "":map.get("org_code").toString(); String org_code = map.get("org_code") == null ? "":map.get("org_code").toString();
......
...@@ -670,8 +670,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -670,8 +670,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
//3.生成含有人员信息的日期执行数据 //3.生成含有人员信息的日期执行数据
// 获取路线中的企业类型和设备类型 // 获取路线中的企业类型和设备类型
// Route route = routeDao.getOne(plan.getRouteId()); Route route = routeDao.getOne(plan.getRouteId());
Route route = new Route(); // Route route = new Route();
List<UserDetailsDto> userDetailsDtos = new ArrayList<>(); List<UserDetailsDto> userDetailsDtos = new ArrayList<>();
// 获取用户组下所有的用户信息 // 获取用户组下所有的用户信息
try{ try{
......
...@@ -512,10 +512,10 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String, ...@@ -512,10 +512,10 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
return null; return null;
} }
List<HashMap<String, Object>> wholeList = new ArrayList<>(); List<HashMap<String, Object>> wholeList = new ArrayList<>();
// String deviceType = route.getDeviceType(); String deviceType = route.getEquipType();
// String unitType = route.getUnitType(); String unitType = route.getEnterpriseType();
String deviceType = "3000"; // String deviceType = "3000";
String unitType = "1232"; // String unitType = "1232";
if (!CollectionUtils.isEmpty(userDetailsDtoList)) { if (!CollectionUtils.isEmpty(userDetailsDtoList)) {
Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream(). Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream().
......
...@@ -20,7 +20,7 @@ ribbon.MaxAutoRetries = 1 ...@@ -20,7 +20,7 @@ ribbon.MaxAutoRetries = 1
xiy_amos_satety_business xiy_amos_satety_business
spring.reactor.debug-agent.enabled=true spring.reactor.debug-agent.enabled=true
#DB properties: #DB properties:
spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=business&allowMultiQueries=true spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=business&allowMultiQueries=true&stringtype=unspecified
spring.datasource.username=admin spring.datasource.username=admin
spring.datasource.password=Yeejoin@2023 spring.datasource.password=Yeejoin@2023
spring.datasource.driver-class-name = cn.com.vastbase.Driver spring.datasource.driver-class-name = cn.com.vastbase.Driver
...@@ -38,7 +38,7 @@ security.appKey=studio_normalapp_3056965 ...@@ -38,7 +38,7 @@ security.appKey=studio_normalapp_3056965
#redis 配置 #redis 配置
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.10.210 spring.redis.host=172.16.10.210
spring.redis.port=6379 spring.redis.port=16379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
......
...@@ -112,51 +112,53 @@ ...@@ -112,51 +112,53 @@
<!--统计-巡检计划 --> <!--统计-巡检计划 -->
<select id="countPlanInfoData" resultType="long"> <select id="countPlanInfoData" resultType="long">
SELECT SELECT
count(1) AS total_num count(1) AS total_num
FROM FROM
p_plan a , p_plan a ,
p_route b p_route b
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if> <if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if> <if test="remark!=null"> and a.remark1 like concat('%',#{remark}::varchar,'%')</if>
<if test="deptId!=null"> and a.dept_id = #{deptId}</if> <if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat('%',#{bizOrgCode}::varchar,'%')</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat('%',#{bizOrgCode}),'%')</if>
</select> </select>
<!--巡检计划查询 --> <!--巡检计划查询 -->
<select id="getPlanInfo" resultType="java.util.HashMap"> <select id="getPlanInfo" resultType="java.util.HashMap">
SELECT SELECT
a.id,a.name , IFNULL(a.plan_begin,"") planBegin,a.status, a.id,a.name , IFNULL(a.plan_begin::varchar,'') planBegin,a.status,
(case a.plan_type (
when 1 THEN '天' case a.plan_type
when 2 THEN '周' when 1 THEN '天'
when 3 THEN '月' when 2 THEN '周'
else '年' END) as planTypeName, when 3 THEN '月'
else '年'
(case a.is_fixed_date end
when 0 THEN '否' ) as planTypeName,
else '是' END) as isFixedDateName, (
IFNULL(a.plan_end,"") planEnd,a.plan_end planEnd,a.plan_type planType, case a.is_fixed_date
b.name routeName,a.route_id routeId,a.is_fixed_date isFixedDate,a.remark,a.remark1, when 0 THEN '否'
b.dept_name bizOrgCode else '是'
end
) as isFixedDateName,
IFNULL(a.plan_end::varchar,'') planEnd,a.plan_end planEnd,a.plan_type planType,
b.name routeName,a.route_id routeId,a.is_fixed_date isFixedDate,a.remark,a.remark1,
b.dept_name bizOrgCode
FROM FROM
p_plan a, p_plan a,
p_route b p_route b
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if> <if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark1 like concat(concat('%',#{remark}),'%')</if> <if test="remark!=null"> and a.remark1 like concat('%',#{remark}::varchar,'%')</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat('%',#{bizOrgCode}),'%')</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat('%',#{bizOrgCode}::varchar,'%')</if>
order by a.id desc order by a.id desc
<choose> <choose>
...@@ -176,18 +178,18 @@ ...@@ -176,18 +178,18 @@
p_route b p_route b
WHERE WHERE
a.is_delete = 0 and a.route_Id = b.id a.is_delete = 0 and a.route_Id = b.id
<if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if> <if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if> <if test="remark!=null"> and a.remark like concat('%',#{remark}::varchar,'%')</if>
<if test="orgCode!=null"> and (a.org_code LIKE CONCAT( #{orgCode}, '-%' ) or a.org_code= #{orgCode} )</if> <if test="orgCode!=null"> and (a.org_code LIKE CONCAT(#{orgCode}::varchar, '-%' ) or a.org_code= #{orgCode} )</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(#{bizOrgCode},'%')</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat(#{bizOrgCode}::varchar,'%')</if>
order by a.id order by a.id
</select> </select>
<select id="queryPlanListByOrgCode" resultType="Map"> <select id="queryPlanListByOrgCode" resultType="Map">
select p.id, p.name from p_plan p where p.is_delete = 0 and and b.biz_org_code like concat(#{loginOrgCode},'%') select p.id, p.name from p_plan p where p.is_delete = 0 and and b.biz_org_code like concat(#{loginOrgCode}::varchar,'%')
</select> </select>
<update id="initUpdatePlanStatus"> <update id="initUpdatePlanStatus">
......
...@@ -11,40 +11,27 @@ ...@@ -11,40 +11,27 @@
LEFT JOIN p_plan_task a ON a.id = b.task_no LEFT JOIN p_plan_task a ON a.id = b.task_no
LEFT JOIN p_point d ON d.id = b.point_id LEFT JOIN p_point d ON d.id = b.point_id
<where> <where>
<if test="pointNo!=null"> and d.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and d.point_no like concat('%',#{pointNo}::varchar,'%')</if>
<if test="pointName!=null"> and d.name like concat('%',#{pointName},'%')</if> <if test="pointName!=null">and d.name like concat('%',#{pointName}::varchar,'%')</if>
<!-- AND-->
<!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''"> <if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate} and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate=='' and endDate != null and endDate != ''"> <if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate!=null and beginDate != '' and endDate == ''"> <if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if> </if>
<if test="status!=null">and b.is_finish = #{status}</if>
<if test="status!=null"> and b.is_finish = #{status}</if> <if test="routeId!=null">and a.route_id = #{routeId}</if>
<if test="planId!=null"> and a.plan_id = #{planId}</if> <if test="planId!=null">and a.plan_id = #{planId}</if>
<if test="routeId!=null"> and a.route_id = #{routeId}</if> <if test="bizOrgCode!=null">and a.org_code like concat (#{bizOrgCode}::varchar,'%')</if>
<if test="orgCode!=null"> <if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode}) and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})
</if> </if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1"> <if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.check_date = curdate() and a.check_date = curdate()
</if> </if>
</where> </where>
order by b.id) t order by b.id) t
</select> </select>
...@@ -91,38 +78,23 @@ ...@@ -91,38 +78,23 @@
<include refid="planTaskInfoSql"/> <include refid="planTaskInfoSql"/>
<where> <where>
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and d.point_no like concat('%',#{pointNo}::varchar,'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName},'%')</if> <if test="pointName!=null">and d.name like concat('%',#{pointName}::varchar,'%')</if>
<!-- AND-->
<!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''"> <if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate} and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate=='' and endDate != null and endDate != ''"> <if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate!=null and beginDate != '' and endDate == ''"> <if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if> </if>
<if test="status!=null">and b.is_finish = #{status}</if> <if test="status!=null">and b.is_finish = #{status}</if>
<if test="routeId!=null">and a.route_id = #{routeId}</if> <if test="routeId!=null">and a.route_id = #{routeId}</if>
<if test="planId!=null">and a.plan_id = #{planId}</if> <if test="planId!=null">and a.plan_id = #{planId}</if>
<if test="bizOrgCode!=null">and a.org_Code like concat (#{bizOrgCode},'%')</if> <if test="bizOrgCode!=null">and a.org_code like concat (#{bizOrgCode}::varchar,'%')</if>
<if test="orgCode!=null"> <if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode}) and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})
</if> </if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1"> <if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.check_date = curdate() and a.check_date = curdate()
......
...@@ -1405,15 +1405,13 @@ ...@@ -1405,15 +1405,13 @@
pp.id pointId pp.id pointId
, pp.name pointName , pp.name pointName
, pp.point_no pointNo , pp.point_no pointNo
, wws.name area
, wws.full_name position
, prp.order_no orderNo , prp.order_no orderNo
, prp.id prpId , prp.id prpId
, prp.exclude_items excludeItems , prp.exclude_items excludeItems
FROM FROM
p_point pp p_point pp
LEFT JOIN wl_warehouse_structure wws
ON pp.risk_source_id = wws.source_id
LEFT JOIN p_route_point prp LEFT JOIN p_route_point prp
ON prp.point_id = pp.id ON prp.point_id = pp.id
WHERE prp.route_id = #{routeId} WHERE prp.route_id = #{routeId}
...@@ -1435,10 +1433,10 @@ ...@@ -1435,10 +1433,10 @@
SELECT SELECT
ppi.id itemId, ppi.id itemId,
pii.name, pii.name,
pii.picture_json photo, pii.picture_json as photo,
pii.basis_json basis, pii.basis_json as basis,
pii.check_method method, pii.check_method as method,
pii.item_type type, pii.item_type as type,
pii.level, pii.level,
pii.risk_desc, pii.risk_desc,
pii.input_classify pii.input_classify
......
...@@ -436,8 +436,8 @@ ...@@ -436,8 +436,8 @@
and ppc.id = #{classifyId} and ppc.id = #{classifyId}
</if> </if>
<if test="inputName!=null and inputName !=''"> <if test="inputName!=null and inputName !=''">
and (pii.name like CONCAT('%', #{inputName}, '%') and (pii.name like CONCAT('%', #{inputName}::varchar, '%')
or pii.item_no like CONCAT('%', #{inputName}, '%')) or pii.item_no like CONCAT('%', #{inputName}::varchar, '%'))
</if> </if>
<if test="isBound!=null and isBound !=''"> <if test="isBound!=null and isBound !=''">
and temp.routePointItemId >0 and temp.routePointItemId >0
...@@ -447,7 +447,7 @@ ...@@ -447,7 +447,7 @@
</select> </select>
<select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route"> <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 * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}::varchar, '%')
</select> </select>
<!--如果查询的点下没有检查项 返回一个标识 --> <!--如果查询的点下没有检查项 返回一个标识 -->
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
left join p_route_point prp on prp.route_id = r.id 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 left join p_route_point_item prpi on prpi.route_point_id = prp.id
WHERE WHERE
r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%') r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}::varchar, '%')
GROUP BY r.id GROUP BY r.id
order by r.create_date DESC order by r.create_date DESC
</select> </select>
......
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