实时表历史表联查显示表数据

This commit is contained in:
lsymicc
2026-06-10 15:02:28 +08:00
parent c10fb6af1c
commit 08ceae0454
7 changed files with 95 additions and 10 deletions

View File

@@ -56,6 +56,18 @@ public class MydoJobController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询作业信息列表
*/
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
@GetMapping("/listUnion")
public TableDataInfo listUnion(MydoJob mydoJob)
{
startPage();
List<MydoJob> list = mydoJobService.selectMydoJobUnionList(mydoJob);
return getDataTable(list);
}
/** /**
* 导出作业信息列表 * 导出作业信息列表
*/ */

View File

@@ -119,4 +119,7 @@ public interface MydoJobMapper
*/ */
void getTaskNo(HashMap<String, Object> map); void getTaskNo(HashMap<String, Object> map);
List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob);
} }

View File

@@ -114,4 +114,6 @@ public interface IMydoJobService
*/ */
String getTaskNo(String type); String getTaskNo(String type);
List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob);
} }

View File

@@ -368,5 +368,9 @@ public class MydoJobServiceImpl implements IMydoJobService
return map.get("v_serial").toString(); return map.get("v_serial").toString();
} }
@Override
public List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob) {
return mydoJobMapper.selectMydoJobUnionList(mydoJob);
}
} }

View File

@@ -38,6 +38,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs_finish select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs_finish
</sql> </sql>
<sql id="selectMydoJobUnion">
SELECT * FROM (
SELECT
job_id,status,task_no,roadway_id,cargo_space_id,target_roadway_id,target_cargo_space_id,priority,execution_phase,in_or_out,create_time,start_time,finish_time,entrance_id,exit_id,warehouse_id,fault_flag,flag,tray_code,tray_size,wms_task_no,'mydo_job_wcs' AS source_table
FROM mydo_job_wcs
UNION ALL
SELECTjob_id,status,task_no,roadway_id,cargo_space_id,target_roadway_id,target_cargo_space_id,priority,execution_phase,in_or_out,create_time,start_time,finish_time,entrance_id,exit_id,warehouse_id,fault_flag,flag,tray_code,tray_size,wms_task_no,'mydo_job_wcs_finish' AS source_table
FROM mydo_job_wcs_finish
)
AS combined_jobs
ORDER BY create_time DESC; -- 按创建时间倒序(最新在前)
</sql>
<select id="selectMydoJobUnionList" parameterType="MydoJob" resultMap="MydoJobResult">
<include refid="selectMydoJobUnion"/>
<where>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="taskNo != null and taskNo != ''">and task_no = #{taskNo}</if>
<if test="roadwayId != null and roadwayId != ''">and roadway_id = #{roadwayId}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''">and cargo_space_id = #{cargoSpaceId}</if>
<if test="targetRoadwayId != null and targetRoadwayId != ''">and target_roadway_id = #{targetRoadwayId}
</if>
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''">and target_cargo_space_id =
#{targetCargoSpaceId}
</if>
<if test="priority != null ">and priority = #{priority}</if>
<if test="executionPhase != null and executionPhase != ''">and execution_phase = #{executionPhase}</if>
<if test="inOrOut != null and inOrOut != ''">and in_or_out = #{inOrOut}</if>
<if test="startTime != null and startTime != ''">and start_time = #{startTime}</if>
<if test="finishTime != null and finishTime != ''">and finish_time = #{finishTime}</if>
<if test="entranceId != null and entranceId != ''">and entrance_id = #{entranceId}</if>
<if test="exitId != null and exitId != ''">and exit_id = #{exitId}</if>
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</if>
<if test="flag != null and flag != ''">and flag = #{flag}</if>
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
<if test="epList != null and epList.size() > 0">
and entrance_id in
<foreach item="item" index="index" collection="epList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
</where>
ORDER BY create_time DESC,finish_time DESC;
</select>
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult"> <select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
<include refid="selectMydoJobVo"/> <include refid="selectMydoJobVo"/>
<where> <where>

View File

@@ -18,6 +18,14 @@ export function listMydoJobFinish(query) {
}) })
} }
export function listMydoJobUnion(query) {
return request({
url: '/job/mydoJob/listUnion',
method: 'get',
params: query
})
}
// 查询作业信息详细 // 查询作业信息详细
export function getMydoJob(jobId) { export function getMydoJob(jobId) {
return request({ return request({

View File

@@ -217,7 +217,7 @@
</template> </template>
<script> <script>
import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish, handFinish, resendTaskToEntrance } from "@/api/job/mydoJob" import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish,listMydoJobUnion, handFinish, resendTaskToEntrance } from "@/api/job/mydoJob"
export default { export default {
name: "MydoJob", name: "MydoJob",
@@ -284,19 +284,27 @@ export default {
/** 查询作业信息列表 */ /** 查询作业信息列表 */
getList() { getList() {
this.loading = true this.loading = true
if (this.queryParams.status === '4' || this.queryParams.status === '5') {
listMydoJobFinish(this.queryParams).then(response => { listMydoJobFinish(this.queryParams).then(response => {
this.mydoJobList = response.rows this.mydoJobList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
}) })
} else {
listMydoJob(this.queryParams).then(response => { // if (this.queryParams.status === '4' || this.queryParams.status === '5'
this.mydoJobList = response.rows // || this.queryParams.status === '6') {
this.total = response.total // listMydoJobFinish(this.queryParams).then(response => {
this.loading = false // this.mydoJobList = response.rows
}) // this.total = response.total
} // this.loading = false
// })
// } else {
// listMydoJob(this.queryParams).then(response => {
// this.mydoJobList = response.rows
// this.total = response.total
// this.loading = false
// })
// }
}, },
// 取消按钮 // 取消按钮