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