Commit 42848b59 authored by 王蔡翾's avatar 王蔡翾
Browse files

初始化

parent 6d20c301
......@@ -24,9 +24,9 @@ public class MessageController extends BaseController {
startPage(messageDTO.getPageNum(), messageDTO.getPageSize());
return getDataTable(messageService.queryrobotList(messageDTO));
}
@PostMapping("/save")
public Result save(@RequestBody MessageDTO messageDTO) {
return toAjax(messageService.save(messageDTO));
@PutMapping("/save")
public Result update(@RequestBody MessageDTO messageDTO) {
return toAjax(messageService.updateById(messageDTO));
}
@PutMapping("/reset")
......@@ -35,8 +35,8 @@ public class MessageController extends BaseController {
return Result.success("重置成功");
}
@GetMapping()
public Result<PeopleMessageVO> queryPeople(@RequestParam(name = "stationId")Long stationId) {
return Result.data(messageService.queryPeople(stationId));
public Result<PeopleMessageVO> queryPeople(@RequestParam(name = "stationId")Long stationId, @RequestParam(name = "robotId") Long robotId) {
return Result.data(messageService.queryPeople(stationId,robotId));
}
@PostMapping("page/message")
public TableDataInfo pageMessage(@RequestBody MessageDTO messageDTO) {
......@@ -44,5 +44,4 @@ public class MessageController extends BaseController {
return getDataTable(messageService.querymessageList(messageDTO));
}
}
package com.example.operation_platform.controller;
import com.example.operation_platform.model.dto.OperationRecordDTO;
import com.example.operation_platform.model.vo.OperationRecordVO;
import com.example.operation_platform.service.TbOperationRecordService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/operation/record")
......@@ -29,5 +28,11 @@ public class OperationRecordController extends BaseController {
public Result save(@RequestBody OperationRecordDTO operationRecordDTO) {
return toAjax(tbOperationRecordService.save(operationRecordDTO));
}
@GetMapping()
public Result<List<OperationRecordVO>> queryrecordListById(@RequestParam(name = "stationId")Long stationId, @RequestParam(name = "robotId") Long robotId) {
return Result.data(tbOperationRecordService.queryrecordListById(stationId,robotId));
}
}
......@@ -28,7 +28,7 @@ public interface MessageMapper extends BaseMapper<MessageEntity> {
* 人员信息列表
* @param stationId stationId
*/
PeopleMessageVO queryPeople(@Param("stationId") Long stationId);
PeopleMessageVO queryPeople(@Param("stationId") Long stationId, @Param("robotId") Long robotId);
/**
* 查询泵站人员信息列表
*
......
......@@ -16,5 +16,10 @@ public interface TbOperationRecordMapper extends BaseMapper<TbOperationRecordEnt
* @return List<OperationRecordVO>
*/
List<OperationRecordVO> queryrecordList(OperationRecordDTO operationRecordDTO);
/*根据泵站id和机器人id查询维保记录
* @param operationRecordDTO operationRecordDTO
* @return List<OperationRecordVO>
*/
List<OperationRecordVO> queryrecordListById(long stationId,long robotId);
}
......@@ -32,5 +32,7 @@ public class OperationDoEntity {
@TableField("finish_time")
private Integer finishTime;
private Integer CompletionTime;
@TableField("item_id")
private String itemId;
}
......@@ -10,4 +10,6 @@ public class MessageVO {
private String peopleName;
private String phoneNumber;
private String address;
private String stationId;
private String robotId;
}
......@@ -27,7 +27,7 @@ public interface MessageService extends IService<MessageEntity> {
* 根据泵站查询人员信息列表
* @param stationId stationId
*/
PeopleMessageVO queryPeople(Long stationId);
PeopleMessageVO queryPeople(Long stationId,Long robotId);
/**
* 查询泵站人员信息列表
*
......
......@@ -15,5 +15,10 @@ public interface TbOperationRecordService extends IService<TbOperationRecordEnti
* @return List<OperationRecordVO>
*/
List<OperationRecordVO> queryrecordList(OperationRecordDTO operationRecordDTO);
/*根据泵站id和机器人id查询维保记录
* @param operationRecordDTO operationRecordDTO
* @return List<OperationRecordVO>
*/
List<OperationRecordVO> queryrecordListById(Long stationId,Long robotId);
}
......@@ -23,8 +23,8 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, MessageEntity
this.baseMapper.resetmessage(messageDTO);
}
@Override
public PeopleMessageVO queryPeople(Long stationId) {
return this.baseMapper.queryPeople(stationId);
public PeopleMessageVO queryPeople(Long stationId,Long robotId) {
return this.baseMapper.queryPeople(stationId,robotId);
}
@Override
public List<PeopleMessageVO> querymessageList(MessageDTO messageDTO) {
......
......@@ -18,6 +18,9 @@ public class TbOperationRecordServiceImpl extends ServiceImpl<TbOperationRecordM
public List<OperationRecordVO> queryrecordList(OperationRecordDTO operationRecordDTO) {
return baseMapper.queryrecordList(operationRecordDTO);
}
@Override
public List<OperationRecordVO> queryrecordListById(Long stationId,Long robotId) {
return baseMapper.queryrecordListById(stationId,robotId);
}
}
......@@ -9,7 +9,10 @@
br.name robotName,
tw.worker_name peopleName,
tm.phone_number phoneNumber,
tor.address address
tor.address address,
tm.station_id stationId,
tm.robot_id robotId
from
tb_message tm
left join
......@@ -37,8 +40,8 @@
operation_worker = "0",
warn_message = "0",
operation_message = "0"
WHERE station_id = #{stationId}
AND robot_id = #{robotId}
WHERE id = #{Id}
</update>
<select id="queryPeople" resultType="com.example.operation_platform.model.vo.PeopleMessageVO">
SELECT
......@@ -61,6 +64,9 @@
<if test="stationId != null and stationId != ''">
tm.station_id = #{stationId}
</if>
<if test="robotId != null and robotId != ''">
tm.robot_id = #{robotId}
</if>
</select>
<select id="querymessageList" resultType="com.example.operation_platform.model.vo.PeopleMessageVO">
SELECT
......@@ -82,8 +88,18 @@
LEFT JOIN tb_worker tq ON tm.operation_worker = tq.id
LEFT JOIN bs_station tor ON tm.station_id = tor.id
</select>
<select id="queryByworkerid" resultType="com.example.operation_platform.model.vo.PeopleMessageVO">
<!-- <select id="queryByworkerid" resultType="com.example.operation_platform.model.vo.PeopleMessageVO">-->
<!-- SELECT-->
<!-- o.id id,-->
</select>
<!-- FROM tb_operation o-->
<!-- LEFT JOIN tb_message m-->
<!-- ON m.station_id = o.station_id-->
<!-- AND m.robot_id = o.robot_id-->
<!-- WHERE m.people_id = #{worker_id}-->
<!-- OR m.software_worker = #{worker_id}-->
<!-- OR m.hardware_worker = #{worker_id}-->
<!-- OR m.operation_worker = #{worker_id};-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -12,6 +12,7 @@
bw.worker_name as workerName,
top.operation_type as operationType,
top.status
from tb_operation top
left join bs_robot br on top.robot_id = br.id
left join bs_station bs on top.station_id = bs.id
......@@ -42,6 +43,23 @@
SET status = #{status}
WHERE id = #{id}
</update>
<select id="querymoreDoList" resultType="com.example.operation_platform.model.vo.OperationDoVO">
SELECT
info.*
FROM
tb_operation info
JOIN (
-- 拆分后的ID子查询
SELECT
SUBSTRING_INDEX(SUBSTRING_INDEX(item_id, ',', numbers.n), ',', -1) AS split_id
FROM
tb_operation_item
CROSS JOIN
(SELECT 1 AS n UNION SELECT 2 UNION SELECT 3 UNION SELECT 4) numbers
WHERE
CHAR_LENGTH(item_id) - CHAR_LENGTH(REPLACE(item_id, ',', '')) >= numbers.n - 1
) split_data ON info.item_id = split_data.split_id;
</select>
</mapper>
......@@ -51,4 +51,41 @@
</where>
order by tor.operation_date desc
</select>
<select id="queryrecordListById" resultType="com.example.operation_platform.model.vo.OperationRecordVO">
select
tor.id id,
br.name robotName,
tor.content content,
top.operation_type operationType,
tor.img img,
tk.worker_name workerName,
tor.operation_date operationDate,
bs.name stationName,
tor.note note
from
tb_operation_record tor
left join
tb_operation top
on
tor.operation_id = top.id
left join
tb_worker tk
on
tor.worker_id = tk.id
left join
bs_robot br
on
top.robot_id = br.id
left join
bs_station bs
on
top.station_id = bs.id
left join
tb_operation_job oj
on
tor.operation_job_id = oj.id
where
top.robot_id= #{robotId}
and top.station_id= #{stationId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment