WflLinkContextValueDaoImpl.java
package com.mycim.server.ctx.exec.dao.impl;
import com.mycim.framework.jdbc.JdbcTemplate;
import com.mycim.framework.utils.lang.StringUtils;
import com.mycim.server.ctx.exec.dao.WflLinkContextValueDao;
import com.mycim.valueobject.prp.WflLinkContextValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
/**
* WflLinkContextValueDao 实现
*
* @author pinyan.song
* @version 6.0.0
* @date 2019-10-13
**/
@Repository
public class WflLinkContextValueDaoImpl implements WflLinkContextValueDao {
@Autowired
private JdbcTemplate jdbcTemplate;
@Override
public List<String> getParameterForLot(WflLinkContextValue ctx, List operationParam) {
String sql = " SELECT DISTINCT INSTANCE_ID FROM CONTEXT_VALUE, NAMED_OBJECT WHERE " + " CONTEXT_RRN = ? AND " +
"CONTEXT_KEY10 = TO_CHAR(INSTANCE_RRN) " + " AND CONTEXT_KEY1 = ? AND CONTEXT_KEY2 = ? AND " +
"CONTEXT_KEY3 = ? AND CONTEXT_KEY4 = ? AND CONTEXT_KEY14 = ?";
List args = new ArrayList();
args.add(ctx.getContextRrn());
args.add(ctx.getContextKey1());
args.add(ctx.getContextKey2());
args.add(ctx.getContextKey3());
args.add(ctx.getContextKey4());
args.add(ctx.getContextKey14());
if (operationParam != null && !operationParam.isEmpty()) {
sql += "AND INSTANCE_ID NOT IN (" + StringUtils.repeat(" ?, ", operationParam.size() - 1) + " ?)";
args.addAll(operationParam);
}
return jdbcTemplate.query(sql, args.toArray(), String.class);
}
}