|
|
@@ -169,8 +169,8 @@ public class EquipmentMaintenancePlanJob extends AbstractJob {
|
|
|
|
|
|
// 2025-04-10 修改 不再新增校准记录,用计划记录开流程
|
|
|
String sql = "UPDATE t_mjsbjdxzjhzb a JOIN t_mjsbjdxzjh b ON a.parent_id_ = b.id_ SET a.marks_ = 'record' " +
|
|
|
- "WHERE b.shi_fou_guo_shen_ = '已完成' AND DATE(a.ji_hua_ri_qi_) <= DATE_ADD(CURDATE(), INTERVAL 30 DAY) " +
|
|
|
- "AND DATE(a.ji_hua_ri_qi_) >= CURRENT_DATE AND a.shi_fou_guo_shen_='待处理'";
|
|
|
+ "WHERE b.shi_fou_guo_shen_ = '已完成' and a.ji_hua_ri_qi_<>'' and a.ji_hua_ri_qi_ is not null " +
|
|
|
+ "AND a.ji_hua_ri_qi_ <= DATE_ADD(CURDATE(), INTERVAL 30 DAY) AND a.ji_hua_ri_qi_>= CURRENT_DATE AND a.shi_fou_guo_shen_='待处理''";
|
|
|
commonDao.execute(sql);
|
|
|
|
|
|
// 检定/校准计划与实施记录表_子表
|
|
|
@@ -242,8 +242,8 @@ public class EquipmentMaintenancePlanJob extends AbstractJob {
|
|
|
|
|
|
protected void startWorkflow(String tableName, String formKey, String defKey) {
|
|
|
String fetchSql = "SELECT a.id_ id_ FROM t_mjsbjdxzjhzb a inner join t_mjsbjdxzjh b on a.parent_id_=b.id_ " +
|
|
|
- "where b.shi_fou_guo_shen_='已完成' and a.marks_ = 'record' and a.ji_hua_ri_qi_<=DATE_ADD(CURDATE(), INTERVAL 30 DAY) " +
|
|
|
- "and a.ji_hua_ri_qi_>=CURRENT_DATE and a.shi_fou_guo_shen_='待处理' ";
|
|
|
+ "where b.shi_fou_guo_shen_='已完成' and a.marks_ = 'record' and a.ji_hua_ri_qi_<>'' and a.ji_hua_ri_qi_ is not null " +
|
|
|
+ " and a.ji_hua_ri_qi_<=DATE_ADD(CURDATE(),INTERVAL 30 DAY) and a.ji_hua_ri_qi_>=CURRENT_DATE and a.shi_fou_guo_shen_='待处理' ";
|
|
|
fetchSql = String.format(fetchSql,tableName);
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) commonDao.query(fetchSql);
|
|
|
if (BeanUtils.isEmpty(list)) return;
|