123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- 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<DaZsjk> selectByExample(DaZsjkExample example) {
- List<DaZsjk> 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<String, Object> paramMap, PageBean pageBean) throws Exception {
- ResponseBean rb = new ResponseBean();
- List<DaZsjk> zsjkList = new ArrayList<DaZsjk>();
- 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<String, Object> paramMap) throws Exception {
- ResponseBean rb = new ResponseBean();
- List<DaZsjk> zsjkList = new ArrayList<DaZsjk>();
- 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<String, Object> 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;
- }
- }
|