| | |
| | | |
| | | import com.java110.common.util.StringUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.entity.order.ServiceBusiness; |
| | | import com.java110.entity.service.ServiceSql; |
| | | import com.java110.service.dao.IQueryServiceDAO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Service("queryServiceDAOImpl") |
| | | @Transactional |
| | | public class QueryServiceDAOImpl extends BaseServiceDao implements IQueryServiceDAO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(QueryServiceDAOImpl.class); |
| | | |
| | | /** |
| | | * 防止sql注入 改造成直接用prepareStatement 预处理sql |
| | |
| | | while(rs.next()){ |
| | | Map<String,Object> map = new HashMap<String,Object>(); |
| | | for(int i = 0 ; i < rsmd.getColumnCount() ; i++){ |
| | | String col_name = rsmd.getColumnName(i+1); |
| | | String col_name = rsmd.getColumnLabel(i+1); |
| | | Object col_value = rs.getObject(col_name); |
| | | if(col_value == null){ |
| | | col_value = ""; |
| | |
| | | }finally{ |
| | | try { |
| | | //conn.close(); |
| | | ps.close(); |
| | | rs.close(); |
| | | if( ps!=null) { |
| | | ps.close(); |
| | | } |
| | | if(rs != null) { |
| | | rs.close(); |
| | | } |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public List<ServiceSql> qureyServiceSqlAll() { |
| | | return sqlSessionTemplate.selectList("queryServiceDAOImpl.qureyServiceSqlAll"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询服务业务信息 |
| | | * @return |
| | | */ |
| | | public List<ServiceBusiness> qureyServiceBusiness(){ |
| | | return sqlSessionTemplate.selectList("queryServiceDAOImpl.queryServiceBusiness"); |
| | | } |
| | | } |