package com.sifang.modules.platform.service;

import java.util.Map;

import org.springframework.stereotype.Service;

import com.sifang.modules.sunshine.SystemSetting.utils.StringUtil;
import com.sifang.modules.sys.common.service.BaseService;

@Service
public class FactorySettleRecordService extends BaseService {




	// 列表查询条件
	public String sqlConditions(Map<String, String> map) {
		StringBuilder sb = new StringBuilder("");
		if (map != null) {
			if (StringUtil.checkParamsValid(map.get("serviceType"))) {
				sb.append(" and o.service_type ='" + map.get("serviceType") + "'");
			}
			if (StringUtil.checkParamsValid(map.get("orderNumber"))) {
				sb.append(" and o.number like '%" + map.get("orderNumber") + "%'");
			}
			if (StringUtil.checkParamsValid(map.get("type"))) {
				sb.append(" and a.type like '%" + map.get("type") + "%'");
			}
			if (StringUtil.checkParamsValid(map.get("startTime"))) {
				sb.append(" and a.settlement_time >= '" + map.get("startTime") + " 00:00:00'");
			}
			if (StringUtil.checkParamsValid(map.get("endTime"))) {
				sb.append(" and a.settlement_time <= '" + map.get("endTime") + " 23:59:59'");
			}
			// 默认显示近三个月收支明细
			/*
			 * if (StringUtil.checkParamsValid(map.get("defaultEndTime"))) {
			 * sb.append(" and a.settlement_time >= '" + map.get("defaultStartTime") +
			 * " 00:00:00'"); sb.append(" and a.settlement_time <= '" +
			 * map.get("defaultEndTime") + " 23:59:59'"); }
			 */
		}
		return sb.toString();
	}

}
