123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- 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<SjWbhj> selectByExample(SjWbhjExample example) {
- List<SjWbhj> 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<String, Object> param) {
- Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_MAXTIME_BY_PARAM, param);
- return date;
- }
-
- @Override
- public void insertWbhjListByParam(List<Map<String, Object>> paramMapList) {
- WbhjListSqlMapClientCallback wbhjListSqlMapClientCallback = new WbhjListSqlMapClientCallback();
- wbhjListSqlMapClientCallback.setParamMapList(paramMapList);
- getSqlMapClientTemplate().execute(wbhjListSqlMapClientCallback);
- }
-
- /**
- * 插入数据的回调类
- */
- private class WbhjListSqlMapClientCallback implements SqlMapClientCallback {
- private List<Map<String, Object>> paramMapList;
-
- public void setParamMapList(List<Map<String, Object>> paramMapList) {
- this.paramMapList = paramMapList;
- }
- @Override
- public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
- executor.startBatch();
- for (Map<String, Object> paramMap : paramMapList) {
- executor.insert(XtSqlMapConstant.SQLMAP_INSERT_WBHJLIST_BY_PARAM, paramMap);
- }
- executor.executeBatch();
- return null;
- }
- }
-
- /**
- * 查询一天环控温度
- * @param hm
- * @return
- */
- @SuppressWarnings("unchecked")
- public List<SjWbhj> selectWbhjWdByParam(Map<String, Object> param) {
- List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_WD_BY_PARAM, param);
- return list;
- }
-
- /**
- * 查询一天环控湿度
- * @param hm
- * @return
- */
- @SuppressWarnings("unchecked")
- public List<SjWbhj> selectWbhjSdByParam(Map<String, Object> param) {
- List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_SD_BY_PARAM, param);
- return list;
- }
-
- /**
- * 查询全程环控温度
- */
- @SuppressWarnings("unchecked")
- public List<SjWbhj> selectWbhjQcwdByParam(Map<String, Object> param) {
- List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCWD_BY_PARAM, param);
- return list;
- }
-
- /**
- * 查询全程环控湿度
- */
- @SuppressWarnings("unchecked")
- public List<SjWbhj> selectWbhjQcsdByParam(Map<String, Object> param) {
- List<SjWbhj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_WBHJ_QCSD_BY_PARAM, param);
- return list;
- }
- }
|