123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- 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<SjJllcsj> selectByExample(SjJllcsjExample example) {
- List<SjJllcsj> 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<String, Object> searchParam) {
- Date date = (Date) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_MAX_JLLCSJ_BY_PARAM, searchParam);
- return date;
- }
-
- /**
- * 插入计量料槽
- */
- public void insertJllcsjByParam(List<SjJllcsj> paramMapList) {
- SjJllcsjSqlMapClientCallback sjJllcsjSqlMapClientCallback = new SjJllcsjSqlMapClientCallback();
- sjJllcsjSqlMapClientCallback.setParamMapList(paramMapList);
- getSqlMapClientTemplate().execute(sjJllcsjSqlMapClientCallback);
- }
-
- /**
- * 插入数据的回调类
- */
- private class SjJllcsjSqlMapClientCallback implements SqlMapClientCallback {
- private List<SjJllcsj> paramMapList;
-
- public void setParamMapList(List<SjJllcsj> 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<SjJllcsj> selectJllcsjCslByParam(Map<String, Object> paramMap) {
- List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_CSL_BY_PARAM, paramMap);
- return list;
- }
-
- @SuppressWarnings("unchecked")
- public List<SjJllcsj> selectJllcsjLcidByParam(Map<String, Object> paramMap) {
- List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_BY_PARAM, paramMap);
- return list;
- }
-
- @SuppressWarnings("unchecked")
- public List<SjJllcsj> selectJllcsjLccslByParam(Map<String, Object> paramMap) {
- List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCCSL_BY_PARAM, paramMap);
- return list;
- }
-
- @SuppressWarnings("unchecked")
- public List<SjJllcsj> selectJllcsjLcidCslByParam(Map<String, Object> paramMap) {
- List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_LCID_CSL_BY_PARAM, paramMap);
- return list;
- }
-
- @SuppressWarnings("unchecked")
- public List<SjJllcsj> selectJllcsjHyzsByParam(Map<String, Object> paramMap) {
- List<SjJllcsj> list = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_HYZS_BY_PARAM, paramMap);
- return list;
- }
-
- public String selectJllcsjSumcslByParam(Map<String, Object> paramMap) {
- String csl = (String)getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_SELECT_JLLCSJ_SUM_CSL_BY_PARAM, paramMap);
- return csl;
- }
- }
|