package cn.ksource.web.facade.wechat.uwyw;
|
|
import java.util.HashMap;
|
import java.util.Map;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import cn.ksource.core.dao.BaseDao;
|
import cn.ksource.core.page.PageInfo;
|
import cn.ksource.core.util.ConvertUtil;
|
import cn.ksource.core.util.StringUtil;
|
import cn.ksource.core.web.WebUtil;
|
import cn.ksource.web.Constants;
|
|
@Service("uorderFacade")
|
public class UorderFacadeImpl implements UorderFacade {
|
|
@Autowired
|
private BaseDao baseDao;
|
|
@Override
|
public int umyorderCount(Map<String, String> params) {
|
|
String orderStatus = params.get("flowstate");
|
StringBuilder builder = new StringBuilder("SELECT COUNT(A.ID) FROM WORKFLOW_BASE A ");
|
if(orderStatus.equals("11")){
|
builder.append(", WORKFLOW_NODE C ");
|
}
|
builder.append(" WHERE A.WFSTATE != :ysc ");
|
if(orderStatus.equals("11")){
|
builder.append(" AND C.FLOWID = A.ID AND C.FLOWSTATE = 1 AND C.CURRENT_DEALER_ID IS NOT NULL ");
|
}
|
params.put("ysc", ConvertUtil.obj2StrBlank(Constants.WORKFLOW_BASE_WFSTATE_DELETE));
|
|
builder.append(" AND A.CUSTOMER_ID = :cusId ");
|
|
String type = params.get("type");
|
if(StringUtil.notEmpty(type)) {
|
builder.append(" AND A.BUSINESSTYPE = :businessType");
|
params.put("businessType", type);
|
}
|
|
|
if(StringUtil.notEmpty(orderStatus)&& !orderStatus.equals("11")) {
|
builder.append(" AND A.WFSTATE = :orderStatus ");
|
params.put("orderStatus", orderStatus);
|
}
|
|
return baseDao.queryForInteger(builder.toString(),params);
|
}
|
|
@Override
|
public PageInfo umyorderData(PageInfo pageInfo,Map<String, String> params) {
|
|
String orderStatus = params.get("flowstate");
|
StringBuilder builder = new StringBuilder("SELECT A.* FROM WORKFLOW_BASE A ");
|
if(orderStatus.equals("11")){
|
builder.append(", WORKFLOW_NODE C ");
|
}
|
builder.append("WHERE A.WFSTATE != :ysc ");
|
if(orderStatus.equals("11")){
|
builder.append(" AND C.FLOWID = A.ID AND C.FLOWSTATE = 1 AND C.CURRENT_DEALER_ID IS NOT NULL ");
|
}
|
params.put("ysc", ConvertUtil.obj2StrBlank(Constants.WORKFLOW_BASE_WFSTATE_DELETE));
|
|
builder.append(" AND A.CUSTOMER_ID = :cusId ");
|
|
String type = params.get("type");
|
if(StringUtil.notEmpty(type)) {
|
builder.append(" AND A.BUSINESSTYPE = :businessType");
|
params.put("businessType", type);
|
}
|
|
|
if(StringUtil.notEmpty(orderStatus)&& !orderStatus.equals("11")) {
|
builder.append(" AND A.WFSTATE = :orderStatus ");
|
params.put("orderStatus", orderStatus);
|
}
|
|
|
builder.append(" ORDER BY A.CREATETIME DESC ");
|
|
return baseDao.queryforSplitPageInfo(pageInfo, builder.toString(), params);
|
}
|
}
|