You've already forked FrameTour-BE
feat(printer): 添加打印任务分页查询和重新打印功能- 引入 PageHelper 和 PageInfo 实现分页查询
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
- 新增 PrintTaskMapper 接口方法 queryByCondition 和 updateStatus
- 扩展 PrintTaskEntity 实体类,新增 mpId 和 paper 字段- 在 PrinterController 中新增 /task/page 和 /task/reprint/{id} 接口- 更新 PrintTaskMapper.xml,添加查询和更新状态的 SQL语句- 优化打印任务插入逻辑,补充 mpId 和 paper 字段赋值
This commit is contained in:
@@ -2,7 +2,26 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ycwl.basic.mapper.PrintTaskMapper">
|
||||
<insert id="insertTask">
|
||||
insert into print_task(printer_id, status, printer_name, url, width, height, create_time)
|
||||
values (#{printerId}, 0, #{printerName}, #{url}, #{width}, #{height}, NOW())
|
||||
insert into print_task(printer_id, mp_id, paper, status, printer_name, url, width, height, create_time)
|
||||
values (#{printerId}, #{mpId}, #{paper}, 0, #{printerName}, #{url}, #{width}, #{height}, NOW())
|
||||
</insert>
|
||||
|
||||
<select id="queryByCondition" resultType="com.ycwl.basic.model.pc.printer.entity.PrintTaskEntity">
|
||||
select id, printer_id, status, printer_name, url, width, height, mp_id, paper, create_time, update_time
|
||||
from print_task
|
||||
where 1=1
|
||||
<if test="printerId != null">
|
||||
and printer_id = #{printerId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<update id="updateStatus">
|
||||
update print_task
|
||||
set status = #{status}, update_time = NOW()
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user