Keine Beschreibung

PaperService.java 2.1KB

    package com.ekexiu.console.system.service; import com.ekexiu.console.system.dao.PpaperDao; import com.ekexiu.console.system.po.Ppaper; import com.ekexiu.console.system.po.Ppatent; import org.jfw.apt.annotation.Autowrie; import org.jfw.apt.annotation.DefaultValue; import org.jfw.apt.annotation.Nullable; import org.jfw.apt.web.annotation.Path; import org.jfw.apt.web.annotation.operate.Get; import org.jfw.apt.web.annotation.operate.Post; import org.jfw.apt.web.annotation.param.JdbcConn; import org.jfw.apt.web.annotation.param.PathVar; import org.jfw.util.PageQueryResult; import java.sql.Connection; import java.sql.SQLException; /** * Created by TT on 2017/8/9. */ @Path("/paper") public class PaperService { @Autowrie private PpaperDao ppaperDao; public PpaperDao getPpaperDao() { return ppaperDao; } public void setPpaperDao(PpaperDao ppaperDao) { this.ppaperDao = ppaperDao; } @Path("/pq") @Get public PageQueryResult<Ppaper> pageQueryResult(@JdbcConn Connection con, @Nullable String title, @Nullable String name, int orderBy, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException { if (orderBy == 1) { return this.ppaperDao.queryByTime(con, title == null ? null : "%" + title + "%", name == null ? "%" : "%" + name + "%", bt == null ? null : bt + "000000", et == null ? null : et + "235959", pageSize, pageNo); } if (orderBy == 2) { return this.ppaperDao.queryByPV(con, title == null ? null : "%" + title + "%", name == null ? "%" : "%" + name + "%", bt == null ? null : bt + "000000", et == null ? null : et + "235959", pageSize, pageNo); } return null; } @Post @Path("/sortNum") public void updateSortNum(@JdbcConn(true) Connection con,String id,long sortNum) throws SQLException{ this.ppaperDao.updateSortNum(con, id, sortNum); } @Get @Path("/id/{id}") public Ppaper query(@JdbcConn Connection con, @PathVar String id) throws SQLException { return this.ppaperDao.query(con, id); } }