|  | @ -2,8 +2,10 @@ package com.yihu.iot.service.dict;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | import com.yihu.iot.dao.dict.IotHospitalDao;
 |  | import com.yihu.iot.dao.dict.IotHospitalDao;
 | 
												
													
														
															|  | import com.yihu.jw.entity.iot.dict.IotHospitalDO;
 |  | import com.yihu.jw.entity.iot.dict.IotHospitalDO;
 | 
												
													
														
															|  | 
 |  | import com.yihu.mysql.query.BaseJpaService;
 | 
												
													
														
															|  | import org.apache.commons.lang3.StringUtils;
 |  | import org.apache.commons.lang3.StringUtils;
 | 
												
													
														
															|  | import org.springframework.beans.factory.annotation.Autowired;
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
													
														
															|  | 
 |  | import org.springframework.jdbc.core.BeanPropertyRowMapper;
 | 
												
													
														
															|  | import org.springframework.jdbc.core.JdbcTemplate;
 |  | import org.springframework.jdbc.core.JdbcTemplate;
 | 
												
													
														
															|  | import org.springframework.stereotype.Service;
 |  | import org.springframework.stereotype.Service;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
											
												
													
														
															|  | @ -13,13 +15,14 @@ import java.util.List;
 | 
												
													
														
															|  |  * @author humingfen on 2020/4/27.
 |  |  * @author humingfen on 2020/4/27.
 | 
												
													
														
															|  |  */
 |  |  */
 | 
												
													
														
															|  | @Service
 |  | @Service
 | 
												
													
														
															|  | public class IotHospitalService {
 |  | 
 | 
												
													
														
															|  | 
 |  | public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospitalDao> {
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private IotHospitalDao hospitalDao;
 |  |     private IotHospitalDao hospitalDao;
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private JdbcTemplate jdbcTemplate;
 |  |     private JdbcTemplate jdbcTemplate;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     public IotHospitalDO create(IotHospitalDO hospitalDO) {
 |  |     public IotHospitalDO create(IotHospitalDO hospitalDO) {
 | 
												
													
														
															|  | 
 |  |         hospitalDO.setSaasId(getCode());
 | 
												
													
														
															|  |         hospitalDO.setDel("1");
 |  |         hospitalDO.setDel("1");
 | 
												
													
														
															|  |         hospitalDao.save(hospitalDO);
 |  |         hospitalDao.save(hospitalDO);
 | 
												
													
														
															|  |         return hospitalDO;
 |  |         return hospitalDO;
 | 
												
											
												
													
														
															|  | @ -33,7 +36,7 @@ public class IotHospitalService {
 | 
												
													
														
															|  |         if(page != null && pageSize != null){
 |  |         if(page != null && pageSize != null){
 | 
												
													
														
															|  |             sql += "limit " + (page-1)*pageSize + "," + pageSize;
 |  |             sql += "limit " + (page-1)*pageSize + "," + pageSize;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         List<IotHospitalDO> list = jdbcTemplate.queryForList(sql, IotHospitalDO.class);
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<IotHospitalDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(IotHospitalDO.class));
 | 
												
													
														
															|  |         return list;
 |  |         return list;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | }
 |  | }
 |