YLDExecuteService.java 2.8 KB
package com.service.bkyld;

import java.util.List;

import com.dao.bkyld.YLDDataBase;
import com.vo.YLDDataManage;
import com.vo.YLD_outline_DataManage;
import com.vo.YLD_reason_DataManage;
import com.vo.yld_Sound;

public class YLDExecuteService {
	YLDDataBase ylddb = new YLDDataBase();

	/**
	 * 在线数据修改
	 * 
	 * @param dm
	 */
	public void getDataManageUpdate(YLDDataManage dm) {
		ylddb.updateData(dm);
	}
	public boolean getDataManageUpdate(YLD_outline_DataManage dm) {
		return ylddb.updateData(dm);
	}
	public boolean insertoutlinedata(YLD_outline_DataManage data){
		return ylddb.insertData(data);
	}
	/**
	 * 在线数据查询
	 */
	public String getDataForDB(String datetime) {
		List<YLDDataManage> loaddata = ylddb.getDataForDate(datetime);
		String resultbegin = "{totalProperty:'" + loaddata.size() + "',root:[";
		for (int t = 0; t < loaddata.size(); t++) {
			if (t == 0) {
				resultbegin += loaddata.get(t).toString();
			} else {
				resultbegin += "," + loaddata.get(t).toString();
			}
		}
		resultbegin += "]}";
		return resultbegin;
	}
	/**
	 * 手工数据查询
	 * @param datetime
	 * @return
	 */
	public String getoutlineDataForDB(String datetime) {
		List<YLD_outline_DataManage> loaddata = ylddb.getDataForDate_outline(datetime);
		String resultbegin = "{totalProperty:'" + loaddata.size() + "',root:[";
		for (int t = 0; t < loaddata.size(); t++) {
			if (t == 0) {
				resultbegin += loaddata.get(t).toString();
			} else {
				resultbegin += "," + loaddata.get(t).toString();
			}
		}
		resultbegin += "]}";
		return resultbegin;
	}
	/**
	 * 未开展自行监控查询
	 * @param datetime
	 * @return
	 */
	public String getreasonDataForDB(String datetime) {
		List<YLD_reason_DataManage> loaddata = ylddb.getDataForDate_reason(datetime);
		String resultbegin = "{totalProperty:'" + loaddata.size() + "',root:[";
		for (int t = 0; t < loaddata.size(); t++) {
			if (t == 0) {
				resultbegin += loaddata.get(t).toString();
			} else {
				resultbegin += "," + loaddata.get(t).toString();
			}
		}
		resultbegin += "]}";
		return resultbegin;
	}
	public String getSounds(String datetime) {
		String re = ylddb.getSounds(datetime);
		return "{totalProperty:'123',root:[" + re + "]}";
	}
	public boolean insertSound(yld_Sound sh) {
		return ylddb.insertSound(sh);
	}
	public boolean updataSound(yld_Sound sh) {
		return ylddb.updataSound(sh);
	}
	public List<Integer> selectSound(String date){
		return ylddb.selectSound(date);
	}
//	public boolean insertreasondata(YLD_reason_DataManage sh) {
//		return ylddb.insertreasondata(sh);
//	}
	/**
	 * 添加自行监测原因
	 * @param sh
	 * @return
	 */
	public boolean updatereasondata(YLD_reason_DataManage sh) {
		return ylddb.updatereasondata(sh);
	}
}