SHExecuteService.java 2.7 KB
package com.service.bksh;

import java.util.List;

import com.dao.bksh.SHDataBase;
import com.vo.SHDataManage;
import com.vo.SH_outline_DataManage;
import com.vo.SH_reason_DataManage;
import com.vo.sh_Sound;

public class SHExecuteService {
	SHDataBase shdb = new SHDataBase();

	/**
	 * 在线数据修改
	 * 
	 * @param dm
	 */
	public void getDataManageUpdate(SHDataManage dm) {
		shdb.updateData(dm);
	}

	public boolean getDataManageUpdate(SH_outline_DataManage dm) {
		return shdb.updateData(dm);
	}

	public boolean insertoutlinedata(SH_outline_DataManage data) {
		return shdb.insertData(data);
	}

	/**
	 * 后台每日监测数据
	 */
	public String getDataForDB(String datetime) {
		List<SHDataManage> loaddata = shdb.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<SH_outline_DataManage> loaddata = shdb
				.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;
	}

	public String getSounds(String datetime) {
		String re = shdb.getSounds(datetime);
		return "{totalProperty:'123',root:[" + re + "]}";
	}

	public boolean insertSound(sh_Sound sh) {
		return shdb.insertSound(sh);
	}
	public boolean updataSound(sh_Sound sh) {
		return shdb.updataSound(sh);
	}
	public List<Integer> selectSound(String date){
		return shdb.selectSound(date);
	}
	/**
	 * 未开展自行监控查询
	 * @param datetime
	 * @return
	 */
	public String getreasonDataForDB(String datetime) {
		List<SH_reason_DataManage> loaddata = shdb.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;
	}
	/**
	 * 添加自行监测原因
	 * @param sh
	 * @return
	 */
	public boolean updatereasondata(SH_reason_DataManage sh) {
		return shdb.updatereasondata(sh);
	}
}