package com.huimv.sj.dao; import com.huimv.busi.sj.dto.SjdlslDTO; import com.huimv.busi.xt.constant.XtSqlMapConstant; import com.huimv.busi.xt.utils.DynamicDataSourceHolder; import com.huimv.sj.dataobject.SjHkdl; import com.huimv.sj.dataobject.SjHkdlExample; import com.ibatis.sqlmap.client.SqlMapExecutor; import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; import java.sql.SQLException; import java.util.List; import java.util.Map; import org.springframework.orm.ibatis.SqlMapClientCallback; public class SjHkdlDAOImpl extends SqlMapClientDaoSupport implements SjHkdlDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public SjHkdlDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int countByExample(SjHkdlExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_hk_dl.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int deleteByExample(SjHkdlExample example) { int rows = getSqlMapClientTemplate().delete("sj_hk_dl.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int deleteByPrimaryKey(Integer id) { SjHkdl key = new SjHkdl(); key.setId(id); int rows = getSqlMapClientTemplate().delete("sj_hk_dl.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public void insert(SjHkdl record) { getSqlMapClientTemplate().insert("sj_hk_dl.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public void insertSelective(SjHkdl record) { getSqlMapClientTemplate().insert("sj_hk_dl.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ @SuppressWarnings("unchecked") public List selectByExample(SjHkdlExample example) { List list = getSqlMapClientTemplate().queryForList("sj_hk_dl.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public SjHkdl selectByPrimaryKey(Integer id) { SjHkdl key = new SjHkdl(); key.setId(id); SjHkdl record = (SjHkdl) getSqlMapClientTemplate().queryForObject("sj_hk_dl.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int updateByExampleSelective(SjHkdl record, SjHkdlExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_hk_dl.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int updateByExample(SjHkdl record, SjHkdlExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_hk_dl.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int updateByPrimaryKeySelective(SjHkdl record) { int rows = getSqlMapClientTemplate().update("sj_hk_dl.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ public int updateByPrimaryKey(SjHkdl record) { int rows = getSqlMapClientTemplate().update("sj_hk_dl.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table sj_hk_dl * * @ibatorgenerated Wed Sep 27 10:21:20 CST 2017 */ private static class UpdateByExampleParms extends SjHkdlExample { private Object record; public UpdateByExampleParms(Object record, SjHkdlExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } /** * 插入环控氧气 */ public void insertHkdlByParam(List paramMapList) { SjHkdlSqlMapClientCallback sjHkdlSqlMapClientCallback = new SjHkdlSqlMapClientCallback(); sjHkdlSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(sjHkdlSqlMapClientCallback); } /** * 插入数据的回调类 */ private class SjHkdlSqlMapClientCallback implements SqlMapClientCallback { private List paramMapList; public void setParamMapList(List paramMapList) { this.paramMapList = paramMapList; } @Override public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (SjHkdl sjHkdl : paramMapList) { executor.insert("sj_hk_dl.ibatorgenerated_insertSelective", sjHkdl); } executor.executeBatch(); return null; } } @SuppressWarnings("unchecked") public List selectQcdlByParam(Map searchParam) { DynamicDataSourceHolder.setRouteKey(""); List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_QCHKDL_BY_PARAM, searchParam); DynamicDataSourceHolder.removeRouteKey(); return list; } @SuppressWarnings("unchecked") public List selectDqdlByParam(Map searchParam) { DynamicDataSourceHolder.setRouteKey(""); List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_DQHKDL_BY_PARAM, searchParam); DynamicDataSourceHolder.removeRouteKey(); return list; } @SuppressWarnings("unchecked") public List selectHkdlCgqidByParam(Map searchParam) { DynamicDataSourceHolder.setRouteKey(""); List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_HKDL_CGQID_BY_PARAM, searchParam); DynamicDataSourceHolder.removeRouteKey(); return list; } @SuppressWarnings("unchecked") public List selectHkdlEveryhourByParam(Map searchParam) { DynamicDataSourceHolder.setRouteKey(""); List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_HKDL_EVERYHOUR_BY_PARAM, searchParam); DynamicDataSourceHolder.removeRouteKey(); return list; } }