package com.huimv.sj.dao; import java.sql.SQLException; import java.util.Date; import java.util.List; import java.util.Map; import org.springframework.orm.ibatis.SqlMapClientCallback; import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; import com.huimv.busi.xt.constant.XtSqlMapConstant; import com.huimv.sj.dataobject.SjWbhj; import com.huimv.sj.dataobject.SjWbhjExample; import com.ibatis.sqlmap.client.SqlMapExecutor; public class SjWbhjDAOImpl extends SqlMapClientDaoSupport implements SjWbhjDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public SjWbhjDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int countByExample(SjWbhjExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_wbhj.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int deleteByExample(SjWbhjExample example) { int rows = getSqlMapClientTemplate().delete("sj_wbhj.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int deleteByPrimaryKey(Integer id) { SjWbhj key = new SjWbhj(); key.setId(id); int rows = getSqlMapClientTemplate().delete("sj_wbhj.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public void insert(SjWbhj record) { getSqlMapClientTemplate().insert("sj_wbhj.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public void insertSelective(SjWbhj record) { getSqlMapClientTemplate().insert("sj_wbhj.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ @SuppressWarnings("unchecked") public List selectByExample(SjWbhjExample example) { List list = getSqlMapClientTemplate().queryForList("sj_wbhj.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public SjWbhj selectByPrimaryKey(Integer id) { SjWbhj key = new SjWbhj(); key.setId(id); SjWbhj record = (SjWbhj) getSqlMapClientTemplate().queryForObject("sj_wbhj.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int updateByExampleSelective(SjWbhj record, SjWbhjExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int updateByExample(SjWbhj record, SjWbhjExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int updateByPrimaryKeySelective(SjWbhj record) { int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ public int updateByPrimaryKey(SjWbhj record) { int rows = getSqlMapClientTemplate().update("sj_wbhj.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table sj_wbhj * * @ibatorgenerated Tue Nov 10 13:30:52 CST 2015 */ private static class UpdateByExampleParms extends SjWbhjExample { private Object record; public UpdateByExampleParms(Object record, SjWbhjExample example) { super(example); this.record = record; } @SuppressWarnings("unused") public Object getRecord() { return record; } } public Date selectMaxtimeByParam(Map param) { Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_MAXTIME_BY_PARAM, param); return date; } @Override public void insertWbhjListByParam(List> paramMapList) { WbhjListSqlMapClientCallback wbhjListSqlMapClientCallback = new WbhjListSqlMapClientCallback(); wbhjListSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(wbhjListSqlMapClientCallback); } /** * 插入数据的回调类 */ private class WbhjListSqlMapClientCallback implements SqlMapClientCallback { private List> paramMapList; public void setParamMapList(List> paramMapList) { this.paramMapList = paramMapList; } @Override public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (Map paramMap : paramMapList) { executor.insert(XtSqlMapConstant.SQLMAP_INSERT_WBHJLIST_BY_PARAM, paramMap); } executor.executeBatch(); return null; } } /** * 查询一天环控温度 * @param hm * @return */ @SuppressWarnings("unchecked") public List selectWbhjWdByParam(Map param) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_WD_BY_PARAM, param); return list; } /** * 查询一天环控湿度 * @param hm * @return */ @SuppressWarnings("unchecked") public List selectWbhjSdByParam(Map param) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_SD_BY_PARAM, param); return list; } /** * 查询全程环控温度 */ @SuppressWarnings("unchecked") public List selectWbhjQcwdByParam(Map param) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCWD_BY_PARAM, param); return list; } /** * 查询全程环控湿度 */ @SuppressWarnings("unchecked") public List selectWbhjQcsdByParam(Map param) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCSD_BY_PARAM, param); return list; } }