Commit 2c0c66e6 by 林永健

解析SQL添加默认后缀

1 parent e94debf0
...@@ -34,6 +34,7 @@ import java.util.stream.Collectors; ...@@ -34,6 +34,7 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class SopDataService { public class SopDataService {
private final String updateStagePrefix = "update cdp_customer_sop_journey set sop_journey_stage='%1$s',sop_journey_stage_enter_time=now() where sop_journey_stage!='%1$s' and sop_journey_id='%2$s'"; private final String updateStagePrefix = "update cdp_customer_sop_journey set sop_journey_stage='%1$s',sop_journey_stage_enter_time=now() where sop_journey_stage!='%1$s' and sop_journey_id='%2$s'";
private final String updateStageSuffix = "update cdp_customer_sop_journey t3, (SELECT t1.extra->>'$.sopJourneyStage' as sopJourneyStage,t1.one_id as oneId,t1.org_id as orgId FROM cdp_customer_event t1, (select max(id) as id from cdp_customer_event where org_id='${merchantId}' and event_type='MODIFY_SOP_JOURNEY_STAGE' group by one_id,org_id,extra->>'$.sopJourneyStage') t2 where t1.id=t2.id) t4 set t3.sop_journey_stage=t4.sopJourneyStage,t3.sop_journey_stage_enter_time=now() where t3.one_id=t4.oneId and t3.org_id=t4.orgId and t3.sop_journey_id='${instId}' and t3.sop_journey_stage!=t4.sopJourneyStage;";
@Autowired @Autowired
private SopDataFilterActionMapper sopDataFilterActionMapper; private SopDataFilterActionMapper sopDataFilterActionMapper;
...@@ -208,6 +209,7 @@ public class SopDataService { ...@@ -208,6 +209,7 @@ public class SopDataService {
} }
res.put(k, actions.stream().map(p -> parseSQL(p, stageName, inst.getInstId())).collect(Collectors.joining(" "))); res.put(k, actions.stream().map(p -> parseSQL(p, stageName, inst.getInstId())).collect(Collectors.joining(" ")));
}); });
res.put("suffix", updateStageSuffix);
return res; return res;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!