12345678910111213141516171819202122232425262728293031323334353637383940 |
- package com.gyee.benchmarkinghive.service;
- import com.gyee.benchmarkinghive.model.auto.Line;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.jdbc.core.RowMapper;
- import org.springframework.stereotype.Service;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.util.List;
- /**
- * @ClassName : LineService
- * @Author : xieshengjie
- * @Date: 2021/6/15 18:08
- * @Description : 线路service
- */
- @Service
- public class LineService extends GenericService {
- public List<Line> lineList(){
- List<Line> lineList = jdbcTemplate.query("select * from gyee_test.line", new RowMapper<Line>() {
- @Override
- public Line mapRow(ResultSet rs, int rowNum) throws SQLException {
- Line line = new Line();
- line.setId(rs.getString("id"));
- line.setCode(rs.getString("code"));
- line.setName(rs.getString("name"));
- line.setAname(rs.getString("aname"));
- line.setProjectid(rs.getString("projectid"));
- line.setOrdernum(rs.getInt("ordernum"));
- line.setCapacity(rs.getDouble("capacity"));
- line.setCapacityunit(rs.getString("capacityunit"));
- line.setQuantity(rs.getInt("quantity"));
- return line;
- }
- });
- return lineList;
- }
- }
|