package com.huimv.sjlr.dao; import java.sql.SQLException; 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.sjlr.dataobject.SjlrMzda; import com.huimv.sjlr.dataobject.SjlrZzxs; import com.huimv.sjlr.dataobject.SjlrZzxsExample; import com.ibatis.sqlmap.client.SqlMapExecutor; public class SjlrZzxsDAOImpl extends SqlMapClientDaoSupport implements SjlrZzxsDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public SjlrZzxsDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int countByExample(SjlrZzxsExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("sjlr_zzxs.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int deleteByExample(SjlrZzxsExample example) { int rows = getSqlMapClientTemplate().delete("sjlr_zzxs.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int deleteByPrimaryKey(Integer id) { SjlrZzxs key = new SjlrZzxs(); key.setId(id); int rows = getSqlMapClientTemplate().delete("sjlr_zzxs.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public void insert(SjlrZzxs record) { getSqlMapClientTemplate().insert("sjlr_zzxs.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public void insertSelective(SjlrZzxs record) { getSqlMapClientTemplate().insert("sjlr_zzxs.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ @SuppressWarnings("unchecked") public List selectByExample(SjlrZzxsExample example) { List list = getSqlMapClientTemplate().queryForList("sjlr_zzxs.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public SjlrZzxs selectByPrimaryKey(Integer id) { SjlrZzxs key = new SjlrZzxs(); key.setId(id); SjlrZzxs record = (SjlrZzxs) getSqlMapClientTemplate().queryForObject("sjlr_zzxs.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int updateByExampleSelective(SjlrZzxs record, SjlrZzxsExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sjlr_zzxs.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int updateByExample(SjlrZzxs record, SjlrZzxsExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("sjlr_zzxs.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int updateByPrimaryKeySelective(SjlrZzxs record) { int rows = getSqlMapClientTemplate().update("sjlr_zzxs.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ public int updateByPrimaryKey(SjlrZzxs record) { int rows = getSqlMapClientTemplate().update("sjlr_zzxs.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table sjlr_zzxs * * @ibatorgenerated Wed Mar 08 10:45:12 CST 2017 */ private static class UpdateByExampleParms extends SjlrZzxsExample { private Object record; public UpdateByExampleParms(Object record, SjlrZzxsExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } @Override public List selectZzxsListByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzxsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZXS_BY_PARAM, paramMap); return zzxsList; } @Override public List selectZzxsDaListByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzxsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZXS_DA_BY_PARAM, paramMap); return zzxsList; } @Override public List selectZzdsListByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzdsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZDS_BY_PARAM, paramMap); return zzdsList; } @Override public List selectZzdsDaListByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzdsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZDS_BY_PARAM, paramMap); return zzdsList; } /** * 更新待售种猪 */ public void updateZzdsByParam(List paramMapList) { HpSjlrZzdsupSqlMapClientCallback hpSjlrZzdsupSqlMapClientCallback = new HpSjlrZzdsupSqlMapClientCallback(); hpSjlrZzdsupSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(hpSjlrZzdsupSqlMapClientCallback); } /** * 更新数据的回调类 */ private class HpSjlrZzdsupSqlMapClientCallback implements SqlMapClientCallback { private List paramMapList; public void setParamMapList(List paramMapList) { this.paramMapList = paramMapList; } @Override public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (SjlrZzxs sjlrZzxs : paramMapList) { executor.update("sjlr_zzxs.ibatorgenerated_updateByExampleSelective", sjlrZzxs); } executor.executeBatch(); return null; } } /** * 上传待售种猪 */ public void insertZzdsByParam(List paramMapList) { HpSjlrZzdsSqlMapClientCallback hpSjlrZzdsSqlMapClientCallback = new HpSjlrZzdsSqlMapClientCallback(); hpSjlrZzdsSqlMapClientCallback.setParamMapList(paramMapList); getSqlMapClientTemplate().execute(hpSjlrZzdsSqlMapClientCallback); } /** *上传数据的回调类 */ private class HpSjlrZzdsSqlMapClientCallback implements SqlMapClientCallback { private List paramMapList; public void setParamMapList(List paramMapList) { this.paramMapList = paramMapList; } @Override public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); for (SjlrZzxs sjlrZzxs : paramMapList) { executor.insert("sjlr_zzxs.ibatorgenerated_insertSelective", sjlrZzxs); } executor.executeBatch(); return null; } } @Override public List selectZzdsAlltByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzdsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZDSTJ_BY_PARAM, paramMap); return zzdsList; } @Override public List selectZzxsAllListByParam(Map paramMap) { @SuppressWarnings("unchecked") List zzdsList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_SJLR_ZZXSlIST_BY_PARAM, paramMap); return zzdsList; } }