package com.huimv.da.dao; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport; import com.huimv.busi.base.dto.ResponseBean; import com.huimv.busi.xt.constant.XtSqlMapConstant; import com.huimv.da.dataobject.DaZsjk; import com.huimv.da.dataobject.DaZsjkExample; import com.huimv.web.base.PageBean; public class DaZsjkDAOImpl extends SqlMapClientDaoSupport implements DaZsjkDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public DaZsjkDAOImpl() { super(); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int countByExample(DaZsjkExample example) { Integer count = (Integer) getSqlMapClientTemplate().queryForObject("da_zsjk.ibatorgenerated_countByExample", example); return count; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int deleteByExample(DaZsjkExample example) { int rows = getSqlMapClientTemplate().delete("da_zsjk.ibatorgenerated_deleteByExample", example); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int deleteByPrimaryKey(Integer id) { DaZsjk key = new DaZsjk(); key.setId(id); int rows = getSqlMapClientTemplate().delete("da_zsjk.ibatorgenerated_deleteByPrimaryKey", key); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public void insert(DaZsjk record) { getSqlMapClientTemplate().insert("da_zsjk.ibatorgenerated_insert", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public void insertSelective(DaZsjk record) { getSqlMapClientTemplate().insert("da_zsjk.ibatorgenerated_insertSelective", record); } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ @SuppressWarnings("unchecked") public List selectByExample(DaZsjkExample example) { List list = getSqlMapClientTemplate().queryForList("da_zsjk.ibatorgenerated_selectByExample", example); return list; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public DaZsjk selectByPrimaryKey(Integer id) { DaZsjk key = new DaZsjk(); key.setId(id); DaZsjk record = (DaZsjk) getSqlMapClientTemplate().queryForObject("da_zsjk.ibatorgenerated_selectByPrimaryKey", key); return record; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int updateByExampleSelective(DaZsjk record, DaZsjkExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByExampleSelective", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int updateByExample(DaZsjk record, DaZsjkExample example) { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByExample", parms); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int updateByPrimaryKeySelective(DaZsjk record) { int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ public int updateByPrimaryKey(DaZsjk record) { int rows = getSqlMapClientTemplate().update("da_zsjk.ibatorgenerated_updateByPrimaryKey", record); return rows; } /** * This class was generated by Apache iBATIS ibator. * This class corresponds to the database table da_zsjk * * @ibatorgenerated Tue Jan 20 15:15:49 CST 2015 */ private static class UpdateByExampleParms extends DaZsjkExample { private Object record; public UpdateByExampleParms(Object record, DaZsjkExample example) { super(example); this.record = record; } @SuppressWarnings("unused") public Object getRecord() { return record; } } /** * 根据参数获取猪舍监控 * * @param paramMap * @param pageBean * @return * @throws Exception */ @SuppressWarnings("unchecked") public ResponseBean getZsjkByParam(Map paramMap, PageBean pageBean) throws Exception { ResponseBean rb = new ResponseBean(); List zsjkList = new ArrayList(); int count = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_COUNT_ZSJK_BY_PARAM, paramMap); if (null != pageBean) { int startRecord = pageBean.getCurrentPageFirstRecord(); int endRecord = pageBean.getPageSize(); paramMap.put("startRecord", startRecord); paramMap.put("endRecord", endRecord); zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap); pageBean.setRecordCount(count); } else { paramMap.put("startRecord", 0); paramMap.put("endRecord", count); zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap); } rb.setResult(zsjkList); rb.setReturnCode(count); return rb; } /** * 根据栏期获取猪舍监控 * * @param paramMap * @param pageBean * @return * @throws Exception */ @SuppressWarnings("unchecked") public ResponseBean getZsjkBylqid(Map paramMap) throws Exception { ResponseBean rb = new ResponseBean(); List zsjkList = new ArrayList(); int count = (Integer) getSqlMapClientTemplate().queryForObject(XtSqlMapConstant.SQLMAP_COUNT_ZSJK_BY_LQID, paramMap); paramMap.put("startRecord", 0); paramMap.put("endRecord", count); zsjkList = getSqlMapClientTemplate().queryForList(XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_LQID, paramMap); rb.setResult(zsjkList); rb.setReturnCode(count); return rb; } /** * 根据ID获取档案 * * @param paramMap * @return * @throws Exception */ public DaZsjk getZsjkById(Map paramMap) throws Exception { paramMap.put("startRecord", 0); paramMap.put("endRecord", 1); DaZsjk zsjk = (DaZsjk) getSqlMapClientTemplate().queryForObject( XtSqlMapConstant.SQLMAP_SELECT_ZSJK_BY_PARAM, paramMap); return zsjk; } }