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.SjJllcsj; import com.huimv.sj.dataobject.SjJllcsjExample; import com.ibatis.sqlmap.client.SqlMapExecutor; public class SjJllcsjDAOImpl extends SqlMapClientDaoSupport implements SjJllcsjDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public SjJllcsjDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int countByExample(SjJllcsjExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sj_jllcsj.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int deleteByExample(SjJllcsjExample example) { int rows = getSqlMapClientTemplate().delete("sj_jllcsj.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int deleteByPrimaryKey(Integer id) { SjJllcsj key = new SjJllcsj(); key.setId(id); int rows = getSqlMapClientTemplate().delete("sj_jllcsj.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public void insert(SjJllcsj record) { getSqlMapClientTemplate().insert("sj_jllcsj.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public void insertSelective(SjJllcsj record) { getSqlMapClientTemplate().insert("sj_jllcsj.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ @SuppressWarnings("unchecked") public List selectByExample(SjJllcsjExample example) { List list = getSqlMapClientTemplate().queryForList("sj_jllcsj.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public SjJllcsj selectByPrimaryKey(Integer id) { SjJllcsj key = new SjJllcsj(); key.setId(id); SjJllcsj record = (SjJllcsj) getSqlMapClientTemplate().queryForObject("sj_jllcsj.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int updateByExampleSelective(SjJllcsj record, SjJllcsjExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_jllcsj.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int updateByExample(SjJllcsj record, SjJllcsjExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sj_jllcsj.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int updateByPrimaryKeySelective(SjJllcsj record) { int rows = getSqlMapClientTemplate().update("sj_jllcsj.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ public int updateByPrimaryKey(SjJllcsj record) { int rows = getSqlMapClientTemplate().update("sj_jllcsj.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table sj_jllcsj * * @ibatorgenerated Fri Apr 01 11:28:45 CST 2016 */ private static class UpdateByExampleParms extends SjJllcsjExample { private Object record; public UpdateByExampleParms(Object record, SjJllcsjExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } /** * 得到指定条件的环境控制记录的最大时间 */ public Date selectMaxJllcsjTimeByParam(Map searchParam) { Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_MAX_JLLCSJ_BY_PARAM, searchParam); return date; } /** * 插入计量料槽 */ public void insertJllcsjByParam(List paramMapList) { SjJllcsjSqlMapClientCallback sjJllcsjSqlMapClientCallback = new SjJllcsjSqlMapClientCallback(); sjJllcsjSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(sjJllcsjSqlMapClientCallback); } /** * 插入数据的回调类 */ private class SjJllcsjSqlMapClientCallback implements SqlMapClientCallback { private List paramMapList; public void setParamMapList(List paramMapList) { this.paramMapList = paramMapList; } @Override public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (SjJllcsj sjJllcsj : paramMapList) { executor.insert("sj_jllcsj.ibatorgenerated_insertSelective", sjJllcsj); } executor.executeBatch(); return null; } } @SuppressWarnings("unchecked") public List selectJllcsjCslByParam(Map paramMap) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_CSL_BY_PARAM, paramMap); return list; } @SuppressWarnings("unchecked") public List selectJllcsjLcidByParam(Map paramMap) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_BY_PARAM, paramMap); return list; } @SuppressWarnings("unchecked") public List selectJllcsjLccslByParam(Map paramMap) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCCSL_BY_PARAM, paramMap); return list; } @SuppressWarnings("unchecked") public List selectJllcsjLcidCslByParam(Map paramMap) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_CSL_BY_PARAM, paramMap); return list; } @SuppressWarnings("unchecked") public List selectJllcsjHyzsByParam(Map paramMap) { List list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_HYZS_BY_PARAM, paramMap); return list; } public String selectJllcsjSumcslByParam(Map paramMap) { String csl = (String)getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_SUM_CSL_BY_PARAM, paramMap); return csl; } }