| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ç¹ç§è®¾å¤ç®¡ç |
| | | -- å½å±ï¼å®å
¨ç产模å |
| | | |
| | | DROP TABLE IF EXISTS special_equipment_ledger; |
| | | CREATE TABLE special_equipment_ledger ( |
| | | id BIGINT NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | equipment_no VARCHAR(64) DEFAULT NULL COMMENT '设å¤ç¼å·', |
| | | equipment_name VARCHAR(128) DEFAULT NULL COMMENT '设å¤åç§°', |
| | | equipment_type VARCHAR(64) DEFAULT NULL COMMENT '设å¤ç±»å«', |
| | | model_spec VARCHAR(128) DEFAULT NULL COMMENT 'è§æ ¼åå·', |
| | | manufacture_date DATE DEFAULT NULL COMMENT 'å¶é æ¥æ', |
| | | install_location VARCHAR(255) DEFAULT NULL COMMENT 'å®è£
ä½ç½®', |
| | | use_unit VARCHAR(255) DEFAULT NULL COMMENT '使ç¨åä½', |
| | | certificate_no VARCHAR(128) DEFAULT NULL COMMENT 'ç¹ç§è®¾å¤ä½¿ç¨ç»è®°è¯å·', |
| | | inspection_cycle_days INT DEFAULT NULL COMMENT 'æ£éªå¨æ(天)', |
| | | next_inspection_date DATE DEFAULT NULL COMMENT '䏿¬¡æ£éªæ¥æ', |
| | | maintenance_cycle_days INT DEFAULT NULL COMMENT 'ç»´ä¿å¨æ(天)', |
| | | next_maintenance_date DATE DEFAULT NULL COMMENT '䏿¬¡ç»´ä¿æ¥æ', |
| | | alarm_days INT DEFAULT 30 COMMENT 'é¢è¦æå天æ°', |
| | | manager_id BIGINT DEFAULT NULL COMMENT 'è´è´£äººID', |
| | | manager_name VARCHAR(64) DEFAULT NULL COMMENT 'è´è´£äºº', |
| | | safety_officer VARCHAR(64) DEFAULT NULL COMMENT 'å®å
¨å', |
| | | risk_level VARCHAR(32) DEFAULT NULL COMMENT 'é£é©ç级', |
| | | latest_inspection_date DATE DEFAULT NULL COMMENT 'ææ°æ£éªæ¥æ', |
| | | latest_maintenance_date DATE DEFAULT NULL COMMENT 'ææ°ç»´ä¿æ¥æ', |
| | | hazard_status TINYINT DEFAULT 0 COMMENT 'éæ£ç¶æ 0-æ 鿣 1-å¾
æ´æ¹ 2-æ´æ¹ä¸ 3-å·²éç¯', |
| | | hazard_description VARCHAR(500) DEFAULT NULL COMMENT '鿣æè¿°', |
| | | rectification_deadline DATE DEFAULT NULL COMMENT 'æ´æ¹æªæ¢æ¥æ', |
| | | remarks VARCHAR(500) DEFAULT NULL COMMENT '夿³¨', |
| | | create_user BIGINT DEFAULT NULL COMMENT 'å建人', |
| | | create_time DATETIME DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | update_user BIGINT DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | update_time DATETIME DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | tenant_id BIGINT DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | dept_id BIGINT DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | PRIMARY KEY (id), |
| | | KEY idx_ledger_equipment_no (equipment_no), |
| | | KEY idx_ledger_next_inspection_date (next_inspection_date), |
| | | KEY idx_ledger_next_maintenance_date (next_maintenance_date), |
| | | KEY idx_ledger_tenant_id (tenant_id), |
| | | KEY idx_ledger_dept_id (dept_id) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ç¹ç§è®¾å¤çµåå°è´¦'; |
| | | |
| | | DROP TABLE IF EXISTS special_equipment_record; |
| | | CREATE TABLE special_equipment_record ( |
| | | id BIGINT NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | equipment_id BIGINT DEFAULT NULL COMMENT '设å¤ID', |
| | | record_type TINYINT DEFAULT NULL COMMENT 'è®°å½ç±»å 1-æ£éª 2-ç»´ä¿', |
| | | record_no VARCHAR(64) DEFAULT NULL COMMENT 'è®°å½ç¼å·', |
| | | record_date DATE DEFAULT NULL COMMENT 'è®°å½æ¥æ', |
| | | execute_result VARCHAR(255) DEFAULT NULL COMMENT 'æ§è¡ç»æ', |
| | | problem_description VARCHAR(500) DEFAULT NULL COMMENT 'é®é¢æè¿°', |
| | | dispose_measure VARCHAR(500) DEFAULT NULL COMMENT 'å¤çæªæ½', |
| | | executor_id BIGINT DEFAULT NULL COMMENT 'æ§è¡äººID', |
| | | executor_name VARCHAR(64) DEFAULT NULL COMMENT 'æ§è¡äºº', |
| | | next_due_date DATE DEFAULT NULL COMMENT '䏿¬¡å°ææ¥æ', |
| | | attachment_remark VARCHAR(500) DEFAULT NULL COMMENT 'é件说æ', |
| | | create_user BIGINT DEFAULT NULL COMMENT 'å建人', |
| | | create_time DATETIME DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | update_user BIGINT DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | update_time DATETIME DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | tenant_id BIGINT DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | dept_id BIGINT DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | PRIMARY KEY (id), |
| | | KEY idx_record_equipment_id (equipment_id), |
| | | KEY idx_record_record_type (record_type), |
| | | KEY idx_record_record_date (record_date), |
| | | KEY idx_record_next_due_date (next_due_date), |
| | | KEY idx_record_tenant_id (tenant_id), |
| | | KEY idx_record_dept_id (dept_id) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ç¹ç§è®¾å¤æ£éªç»´ä¿è®°å½'; |
| | | |
| | | DROP TABLE IF EXISTS special_equipment_rectification; |
| | | CREATE TABLE special_equipment_rectification ( |
| | | id BIGINT NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | equipment_id BIGINT DEFAULT NULL COMMENT '设å¤ID', |
| | | hazard_description VARCHAR(500) DEFAULT NULL COMMENT '鿣æè¿°', |
| | | risk_level VARCHAR(32) DEFAULT NULL COMMENT 'é£é©ç级', |
| | | discovered_date DATE DEFAULT NULL COMMENT 'åç°æ¥æ', |
| | | responsible_user_id BIGINT DEFAULT NULL COMMENT 'æ´æ¹è´£ä»»äººID', |
| | | responsible_user_name VARCHAR(64) DEFAULT NULL COMMENT 'æ´æ¹è´£ä»»äºº', |
| | | rectification_deadline DATE DEFAULT NULL COMMENT 'æ´æ¹æé', |
| | | rectification_status TINYINT DEFAULT 1 COMMENT 'æ´æ¹ç¶æ 1-å¾
æ´æ¹ 2-æ´æ¹ä¸ 3-å¾
夿 ¸ 4-å·²éç¯', |
| | | rectification_measures VARCHAR(500) DEFAULT NULL COMMENT 'æ´æ¹æªæ½', |
| | | rectification_result VARCHAR(500) DEFAULT NULL COMMENT 'æ´æ¹ç»æ', |
| | | closed_date DATE DEFAULT NULL COMMENT 'éç¯æ¥æ', |
| | | remarks VARCHAR(500) DEFAULT NULL COMMENT '夿³¨', |
| | | create_user BIGINT DEFAULT NULL COMMENT 'å建人', |
| | | create_time DATETIME DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | update_user BIGINT DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | update_time DATETIME DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | tenant_id BIGINT DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | dept_id BIGINT DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | PRIMARY KEY (id), |
| | | KEY idx_rect_equipment_id (equipment_id), |
| | | KEY idx_rect_status (rectification_status), |
| | | KEY idx_rect_deadline (rectification_deadline), |
| | | KEY idx_rect_tenant_id (tenant_id), |
| | | KEY idx_rect_dept_id (dept_id) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='ç¹ç§è®¾å¤éæ£æ´æ¹'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.controller; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentLedgerService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | @RestController |
| | | @Tag(name = "å®å
¨ç产--ç¹ç§è®¾å¤çµåå°è´¦") |
| | | @RequestMapping("/safe/specialEquipment/ledger") |
| | | @AllArgsConstructor |
| | | public class SpecialEquipmentLedgerController extends BaseController { |
| | | private final SpecialEquipmentLedgerService service; |
| | | @GetMapping("/listPage") @Operation(summary = "ç¹ç§è®¾å¤å°è´¦-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SpecialEquipmentLedger req) { return AjaxResult.success(service.listPage(page, req)); } |
| | | @GetMapping("/list") @Operation(summary = "ç¹ç§è®¾å¤å°è´¦-å表æ¥è¯¢") |
| | | public AjaxResult list(SpecialEquipmentLedger req) { return AjaxResult.success(service.list(Wrappers.lambdaQuery(req))); } |
| | | @PostMapping("/add") @Log(title = "ç¹ç§è®¾å¤å°è´¦-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "ç¹ç§è®¾å¤å°è´¦-æ°å¢") |
| | | public AjaxResult add(@RequestBody SpecialEquipmentLedger req) { return service.save(req) ? success() : error(); } |
| | | @PostMapping("/update") @Log(title = "ç¹ç§è®¾å¤å°è´¦-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "ç¹ç§è®¾å¤å°è´¦-ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody SpecialEquipmentLedger req) { return service.updateById(req) ? success() : error(); } |
| | | @DeleteMapping("/delete") @Log(title = "ç¹ç§è®¾å¤å°è´¦-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "ç¹ç§è®¾å¤å°è´¦-å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { return service.removeByIds(ids) ? success() : error(); } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.controller; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRecord; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentRecordService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | @RestController |
| | | @Tag(name = "å®å
¨ç产--ç¹ç§è®¾å¤æ£éªç»´ä¿è®°å½") |
| | | @RequestMapping("/safe/specialEquipment/record") |
| | | @AllArgsConstructor |
| | | public class SpecialEquipmentRecordController extends BaseController { |
| | | private final SpecialEquipmentRecordService service; |
| | | @GetMapping("/listPage") @Operation(summary = "æ£éªç»´ä¿è®°å½-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SpecialEquipmentRecord req) { return AjaxResult.success(service.listPage(page, req)); } |
| | | @PostMapping("/add") @Log(title = "æ£éªç»´ä¿è®°å½-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "æ£éªç»´ä¿è®°å½-æ°å¢") |
| | | public AjaxResult add(@RequestBody SpecialEquipmentRecord req) { return service.save(req) ? success() : error(); } |
| | | @PostMapping("/update") @Log(title = "æ£éªç»´ä¿è®°å½-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "æ£éªç»´ä¿è®°å½-ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody SpecialEquipmentRecord req) { return service.updateById(req) ? success() : error(); } |
| | | @DeleteMapping("/delete") @Log(title = "æ£éªç»´ä¿è®°å½-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "æ£éªç»´ä¿è®°å½-å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { return service.removeByIds(ids) ? success() : error(); } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.controller; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRectification; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentRectificationService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | @RestController |
| | | @Tag(name = "å®å
¨ç产--ç¹ç§è®¾å¤éæ£æ´æ¹") |
| | | @RequestMapping("/safe/specialEquipment/rectification") |
| | | @AllArgsConstructor |
| | | public class SpecialEquipmentRectificationController extends BaseController { |
| | | private final SpecialEquipmentRectificationService service; |
| | | @GetMapping("/listPage") @Operation(summary = "éæ£æ´æ¹-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SpecialEquipmentRectification req) { return AjaxResult.success(service.listPage(page, req)); } |
| | | @PostMapping("/add") @Log(title = "éæ£æ´æ¹-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "éæ£æ´æ¹-æ°å¢") |
| | | public AjaxResult add(@RequestBody SpecialEquipmentRectification req) { return service.save(req) ? success() : error(); } |
| | | @PostMapping("/close") @Log(title = "éæ£æ´æ¹-éç¯", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "éæ£æ´æ¹-éç¯") |
| | | public AjaxResult close(@RequestBody SpecialEquipmentRectification req) { req.setRectificationStatus(4); req.setClosedDate(LocalDate.now()); return service.updateById(req) ? success() : error(); } |
| | | @DeleteMapping("/delete") @Log(title = "éæ£æ´æ¹-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "éæ£æ´æ¹-å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { return service.removeByIds(ids) ? success() : error(); } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | import org.apache.ibatis.annotations.Param; |
| | | public interface SpecialEquipmentLedgerMapper extends BaseMapper<SpecialEquipmentLedger> { |
| | | IPage<SpecialEquipmentLedger> listPage(Page page, @Param("req") SpecialEquipmentLedger req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | public interface SpecialEquipmentRecordMapper extends BaseMapper<SpecialEquipmentRecord> { |
| | | IPage<SpecialEquipmentRecord> listPage(Page page, @Param("req") SpecialEquipmentRecord req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRectification; |
| | | import org.apache.ibatis.annotations.Param; |
| | | public interface SpecialEquipmentRectificationMapper extends BaseMapper<SpecialEquipmentRectification> { |
| | | IPage<SpecialEquipmentRectification> listPage(Page page, @Param("req") SpecialEquipmentRectification req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.pojo; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.time.*; |
| | | @Data |
| | | @Schema(description = "ç¹ç§è®¾å¤çµåå°è´¦") |
| | | @TableName("special_equipment_ledger") |
| | | public class SpecialEquipmentLedger { |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(type = IdType.AUTO) private Long id; |
| | | @Excel(name = "设å¤ç¼å·") private String equipmentNo; |
| | | @Excel(name = "设å¤åç§°") private String equipmentName; |
| | | @Excel(name = "设å¤ç±»å«") private String equipmentType; |
| | | @Excel(name = "è§æ ¼åå·") private String modelSpec; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¶é æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate manufactureDate; |
| | | @Excel(name = "å®è£
ä½ç½®") private String installLocation; |
| | | @Excel(name = "使ç¨åä½") private String useUnit; |
| | | @Excel(name = "ç»è®°è¯å·") private String certificateNo; |
| | | @Excel(name = "æ£éªå¨æ(天)") private Integer inspectionCycleDays; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "䏿¬¡æ£éªæ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate nextInspectionDate; |
| | | @Excel(name = "ç»´ä¿å¨æ(天)") private Integer maintenanceCycleDays; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "䏿¬¡ç»´ä¿æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate nextMaintenanceDate; |
| | | @Excel(name = "é¢è¦æå天æ°") private Integer alarmDays; |
| | | private Long managerId; |
| | | @Excel(name = "è´è´£äºº") private String managerName; |
| | | @Excel(name = "å®å
¨å") private String safetyOfficer; |
| | | @Excel(name = "é£é©ç级") private String riskLevel; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ææ°æ£éªæ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate latestInspectionDate; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ææ°ç»´ä¿æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate latestMaintenanceDate; |
| | | @Excel(name = "éæ£ç¶æ", readConverterExp = "0=æ 鿣,1=å¾
æ´æ¹,2=æ´æ¹ä¸,3=å·²éç¯") private Integer hazardStatus; |
| | | @Excel(name = "鿣æè¿°") private String hazardDescription; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ´æ¹æªæ¢æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate rectificationDeadline; |
| | | @Excel(name = "夿³¨") private String remarks; |
| | | @TableField(fill = FieldFill.INSERT) private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.UPDATE) private Long updateUser; |
| | | @TableField(fill = FieldFill.UPDATE) private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) private Long tenantId; |
| | | @TableField(fill = FieldFill.INSERT) private Long deptId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.pojo; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.time.*; |
| | | @Data |
| | | @Schema(description = "ç¹ç§è®¾å¤æ£éªç»´ä¿è®°å½") |
| | | @TableName("special_equipment_record") |
| | | public class SpecialEquipmentRecord { |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(type = IdType.AUTO) private Long id; |
| | | private Long equipmentId; |
| | | @Excel(name = "è®°å½ç±»å", readConverterExp = "1=æ£éª,2=ç»´ä¿") private Integer recordType; |
| | | @Excel(name = "è®°å½ç¼å·") private String recordNo; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "è®°å½æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate recordDate; |
| | | @Excel(name = "æ§è¡ç»æ") private String executeResult; |
| | | @Excel(name = "é®é¢æè¿°") private String problemDescription; |
| | | @Excel(name = "å¤çæªæ½") private String disposeMeasure; |
| | | private Long executorId; |
| | | @Excel(name = "æ§è¡äºº") private String executorName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "䏿¬¡å°ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate nextDueDate; |
| | | @Excel(name = "é件说æ") private String attachmentRemark; |
| | | @TableField(fill = FieldFill.INSERT) private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.UPDATE) private Long updateUser; |
| | | @TableField(fill = FieldFill.UPDATE) private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) private Long tenantId; |
| | | @TableField(fill = FieldFill.INSERT) private Long deptId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.pojo; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.time.*; |
| | | @Data |
| | | @Schema(description = "ç¹ç§è®¾å¤éæ£æ´æ¹") |
| | | @TableName("special_equipment_rectification") |
| | | public class SpecialEquipmentRectification { |
| | | private static final long serialVersionUID = 1L; |
| | | @TableId(type = IdType.AUTO) private Long id; |
| | | private Long equipmentId; |
| | | @Excel(name = "鿣æè¿°") private String hazardDescription; |
| | | @Excel(name = "é£é©ç级") private String riskLevel; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "åç°æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate discoveredDate; |
| | | private Long responsibleUserId; |
| | | @Excel(name = "æ´æ¹è´£ä»»äºº") private String responsibleUserName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ´æ¹æé", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate rectificationDeadline; |
| | | @Excel(name = "æ´æ¹ç¶æ", readConverterExp = "1=å¾
æ´æ¹,2=æ´æ¹ä¸,3=å¾
夿 ¸,4=å·²éç¯") private Integer rectificationStatus; |
| | | @Excel(name = "æ´æ¹æªæ½") private String rectificationMeasures; |
| | | @Excel(name = "æ´æ¹ç»æ") private String rectificationResult; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "éç¯æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private LocalDate closedDate; |
| | | @Excel(name = "夿³¨") private String remarks; |
| | | @TableField(fill = FieldFill.INSERT) private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.UPDATE) private Long updateUser; |
| | | @TableField(fill = FieldFill.UPDATE) private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) private Long tenantId; |
| | | @TableField(fill = FieldFill.INSERT) private Long deptId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | public interface SpecialEquipmentLedgerService extends IService<SpecialEquipmentLedger> { |
| | | IPage<SpecialEquipmentLedger> listPage(Page page, SpecialEquipmentLedger req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRecord; |
| | | public interface SpecialEquipmentRecordService extends IService<SpecialEquipmentRecord> { |
| | | IPage<SpecialEquipmentRecord> listPage(Page page, SpecialEquipmentRecord req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRectification; |
| | | public interface SpecialEquipmentRectificationService extends IService<SpecialEquipmentRectification> { |
| | | IPage<SpecialEquipmentRectification> listPage(Page page, SpecialEquipmentRectification req); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service.impl; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentLedgerMapper; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentLedgerService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import java.time.LocalDateTime; |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SpecialEquipmentLedgerServiceImpl extends ServiceImpl<SpecialEquipmentLedgerMapper, SpecialEquipmentLedger> implements SpecialEquipmentLedgerService { |
| | | private final SpecialEquipmentLedgerMapper mapper; |
| | | public IPage<SpecialEquipmentLedger> listPage(Page page, SpecialEquipmentLedger req) { return mapper.listPage(page, req); } |
| | | public boolean save(SpecialEquipmentLedger entity) { |
| | | entity.setHazardStatus(entity.getHazardStatus() == null ? 0 : entity.getHazardStatus()); |
| | | entity.setTenantId(SecurityUtils.getLoginUser().getTenantId()); |
| | | entity.setCreateUser(SecurityUtils.getLoginUser().getUserId()); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | return super.save(entity); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service.impl; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentLedgerMapper; |
| | | import com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentRecordMapper; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRecord; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentRecordService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import java.time.LocalDateTime; |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SpecialEquipmentRecordServiceImpl extends ServiceImpl<SpecialEquipmentRecordMapper, SpecialEquipmentRecord> implements SpecialEquipmentRecordService { |
| | | private final SpecialEquipmentRecordMapper mapper; |
| | | private final SpecialEquipmentLedgerMapper ledgerMapper; |
| | | |
| | | public IPage<SpecialEquipmentRecord> listPage(Page page, SpecialEquipmentRecord req) { return mapper.listPage(page, req); } |
| | | |
| | | public boolean save(SpecialEquipmentRecord entity) { |
| | | entity.setTenantId(SecurityUtils.getLoginUser().getTenantId()); |
| | | entity.setCreateUser(SecurityUtils.getLoginUser().getUserId()); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | boolean saved = super.save(entity); |
| | | syncLedgerDate(entity); |
| | | return saved; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateById(SpecialEquipmentRecord entity) { |
| | | boolean updated = super.updateById(entity); |
| | | syncLedgerDate(entity); |
| | | return updated; |
| | | } |
| | | |
| | | private void syncLedgerDate(SpecialEquipmentRecord entity) { |
| | | if (entity == null || entity.getEquipmentId() == null || entity.getRecordType() == null) { |
| | | return; |
| | | } |
| | | SpecialEquipmentLedger ledger = ledgerMapper.selectById(entity.getEquipmentId()); |
| | | if (ledger == null) { |
| | | return; |
| | | } |
| | | if (entity.getRecordType() == 1) { |
| | | ledger.setLatestInspectionDate(entity.getRecordDate()); |
| | | ledger.setNextInspectionDate(entity.getNextDueDate()); |
| | | } else if (entity.getRecordType() == 2) { |
| | | ledger.setLatestMaintenanceDate(entity.getRecordDate()); |
| | | ledger.setNextMaintenanceDate(entity.getNextDueDate()); |
| | | } |
| | | ledgerMapper.updateById(ledger); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.service.impl; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentRectificationMapper; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRectification; |
| | | import com.ruoyi.safe.specialequipment.service.SpecialEquipmentRectificationService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import java.time.LocalDateTime; |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SpecialEquipmentRectificationServiceImpl extends ServiceImpl<SpecialEquipmentRectificationMapper, SpecialEquipmentRectification> implements SpecialEquipmentRectificationService { |
| | | private final SpecialEquipmentRectificationMapper mapper; |
| | | public IPage<SpecialEquipmentRectification> listPage(Page page, SpecialEquipmentRectification req) { return mapper.listPage(page, req); } |
| | | public boolean save(SpecialEquipmentRectification entity) { |
| | | entity.setTenantId(SecurityUtils.getLoginUser().getTenantId()); |
| | | entity.setCreateUser(SecurityUtils.getLoginUser().getUserId()); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setRectificationStatus(entity.getRectificationStatus() == null ? 1 : entity.getRectificationStatus()); |
| | | return super.save(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateById(SpecialEquipmentRectification entity) { |
| | | return super.updateById(entity); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safe.specialequipment.task; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.approve.pojo.NotificationManagement; |
| | | import com.ruoyi.approve.service.NotificationManagementService; |
| | | import com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentLedgerMapper; |
| | | import com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import java.time.LocalDate; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class SpecialEquipmentReminderTask { |
| | | private final SpecialEquipmentLedgerMapper ledgerMapper; |
| | | private final NotificationManagementService notificationManagementService; |
| | | private static final int REMIND_DAYS = 30; |
| | | |
| | | @Scheduled(cron = "0 0 8 * * ?") |
| | | public void remindExpire() { |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDate threshold = now.plusDays(REMIND_DAYS); |
| | | List<SpecialEquipmentLedger> list = ledgerMapper.selectList(Wrappers.<SpecialEquipmentLedger>lambdaQuery() |
| | | .and(wrapper -> wrapper |
| | | .isNotNull(SpecialEquipmentLedger::getNextInspectionDate) |
| | | .le(SpecialEquipmentLedger::getNextInspectionDate, threshold) |
| | | .or() |
| | | .isNotNull(SpecialEquipmentLedger::getNextMaintenanceDate) |
| | | .le(SpecialEquipmentLedger::getNextMaintenanceDate, threshold))); |
| | | for (SpecialEquipmentLedger ledger : list) { |
| | | syncReminder(ledger, now, threshold, true); |
| | | syncReminder(ledger, now, threshold, false); |
| | | } |
| | | } |
| | | |
| | | private void syncReminder(SpecialEquipmentLedger ledger, LocalDate now, LocalDate threshold, boolean inspection) { |
| | | LocalDate dueDate = inspection ? ledger.getNextInspectionDate() : ledger.getNextMaintenanceDate(); |
| | | if (dueDate == null || dueDate.isAfter(threshold)) { |
| | | return; |
| | | } |
| | | long daysLeft = ChronoUnit.DAYS.between(now, dueDate); |
| | | String reminderType = inspection ? "æ£éªå°ææé" : "ç»´ä¿å°ææé"; |
| | | String title = ledger.getEquipmentName() + "-" + reminderType; |
| | | String content = String.format("设å¤ã%sã(%s) %sï¼%sï¼è¯·åæ¶å®æå¤çã", |
| | | ledger.getEquipmentName(), |
| | | Optional.ofNullable(ledger.getEquipmentNo()).orElse(""), |
| | | inspection ? "æ£éªå³å°å°æ" : "ç»´ä¿å³å°å°æ", |
| | | daysLeft < 0 ? ("已龿 " + Math.abs(daysLeft) + " 天") : ("è·ç¦»å°æè¿æ " + daysLeft + " 天")); |
| | | NotificationManagement notification = notificationManagementService.lambdaQuery() |
| | | .eq(NotificationManagement::getTitle, title) |
| | | .eq(NotificationManagement::getType, reminderType) |
| | | .oneOpt() |
| | | .orElseGet(NotificationManagement::new); |
| | | notification.setTitle(title); |
| | | notification.setType(reminderType); |
| | | notification.setPriority(daysLeft <= 7 ? "é«" : "ä¸"); |
| | | notification.setStatus("1"); |
| | | notification.setExpireDate(dueDate); |
| | | notification.setContent(content); |
| | | notification.setDepartments(new ArrayList<>()); |
| | | notification.setSyncMethods(new ArrayList<>()); |
| | | if (notification.getId() == null) { |
| | | notificationManagementService.save(notification); |
| | | } else { |
| | | notificationManagementService.updateById(notification); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentLedgerMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentLedger"> |
| | | <id column="id" property="id" /> |
| | | <result column="equipment_no" property="equipmentNo" /> |
| | | <result column="equipment_name" property="equipmentName" /> |
| | | <result column="equipment_type" property="equipmentType" /> |
| | | <result column="model_spec" property="modelSpec" /> |
| | | <result column="manufacture_date" property="manufactureDate" /> |
| | | <result column="install_location" property="installLocation" /> |
| | | <result column="use_unit" property="useUnit" /> |
| | | <result column="certificate_no" property="certificateNo" /> |
| | | <result column="inspection_cycle_days" property="inspectionCycleDays" /> |
| | | <result column="next_inspection_date" property="nextInspectionDate" /> |
| | | <result column="maintenance_cycle_days" property="maintenanceCycleDays" /> |
| | | <result column="next_maintenance_date" property="nextMaintenanceDate" /> |
| | | <result column="alarm_days" property="alarmDays" /> |
| | | <result column="manager_id" property="managerId" /> |
| | | <result column="manager_name" property="managerName" /> |
| | | <result column="safety_officer" property="safetyOfficer" /> |
| | | <result column="risk_level" property="riskLevel" /> |
| | | <result column="latest_inspection_date" property="latestInspectionDate" /> |
| | | <result column="latest_maintenance_date" property="latestMaintenanceDate" /> |
| | | <result column="hazard_status" property="hazardStatus" /> |
| | | <result column="hazard_description" property="hazardDescription" /> |
| | | <result column="rectification_deadline" property="rectificationDeadline" /> |
| | | <result column="remarks" property="remarks" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultMap="BaseResultMap"> |
| | | select l.id, |
| | | l.equipment_no, |
| | | l.equipment_name, |
| | | l.equipment_type, |
| | | l.model_spec, |
| | | l.manufacture_date, |
| | | l.install_location, |
| | | l.use_unit, |
| | | l.certificate_no, |
| | | l.inspection_cycle_days, |
| | | l.next_inspection_date, |
| | | l.maintenance_cycle_days, |
| | | l.next_maintenance_date, |
| | | l.alarm_days, |
| | | l.manager_id, |
| | | COALESCE(u.nick_name, u.user_name) as manager_name, |
| | | l.safety_officer, |
| | | l.risk_level, |
| | | l.latest_inspection_date, |
| | | l.latest_maintenance_date, |
| | | l.hazard_status, |
| | | l.hazard_description, |
| | | l.rectification_deadline, |
| | | l.remarks, |
| | | l.create_user, |
| | | l.create_time, |
| | | l.update_user, |
| | | l.update_time, |
| | | l.tenant_id, |
| | | l.dept_id |
| | | from special_equipment_ledger l |
| | | left join sys_user u on u.user_id = l.manager_id |
| | | where 1=1 |
| | | <if test="req.equipmentName != null and req.equipmentName != ''"> |
| | | and l.equipment_name like concat('%', #{req.equipmentName}, '%') |
| | | </if> |
| | | <if test="req.equipmentType != null and req.equipmentType != ''"> |
| | | and l.equipment_type like concat('%', #{req.equipmentType}, '%') |
| | | </if> |
| | | <if test="req.hazardStatus != null"> |
| | | and l.hazard_status = #{req.hazardStatus} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentRecordMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="equipment_id" property="equipmentId" /> |
| | | <result column="record_type" property="recordType" /> |
| | | <result column="record_no" property="recordNo" /> |
| | | <result column="record_date" property="recordDate" /> |
| | | <result column="execute_result" property="executeResult" /> |
| | | <result column="problem_description" property="problemDescription" /> |
| | | <result column="dispose_measure" property="disposeMeasure" /> |
| | | <result column="executor_id" property="executorId" /> |
| | | <result column="executor_name" property="executorName" /> |
| | | <result column="next_due_date" property="nextDueDate" /> |
| | | <result column="attachment_remark" property="attachmentRemark" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultMap="BaseResultMap"> |
| | | select * |
| | | from special_equipment_record |
| | | where 1=1 |
| | | <if test="req.recordType != null"> |
| | | and record_type = #{req.recordType} |
| | | </if> |
| | | <if test="req.recordNo != null and req.recordNo != ''"> |
| | | and record_no like concat('%', #{req.recordNo}, '%') |
| | | </if> |
| | | <if test="req.equipmentId != null"> |
| | | and equipment_id = #{req.equipmentId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safe.specialequipment.mapper.SpecialEquipmentRectificationMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.safe.specialequipment.pojo.SpecialEquipmentRectification"> |
| | | <id column="id" property="id" /> |
| | | <result column="equipment_id" property="equipmentId" /> |
| | | <result column="hazard_description" property="hazardDescription" /> |
| | | <result column="risk_level" property="riskLevel" /> |
| | | <result column="discovered_date" property="discoveredDate" /> |
| | | <result column="responsible_user_id" property="responsibleUserId" /> |
| | | <result column="responsible_user_name" property="responsibleUserName" /> |
| | | <result column="rectification_deadline" property="rectificationDeadline" /> |
| | | <result column="rectification_status" property="rectificationStatus" /> |
| | | <result column="rectification_measures" property="rectificationMeasures" /> |
| | | <result column="rectification_result" property="rectificationResult" /> |
| | | <result column="closed_date" property="closedDate" /> |
| | | <result column="remarks" property="remarks" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultMap="BaseResultMap"> |
| | | select * |
| | | from special_equipment_rectification |
| | | where 1=1 |
| | | <if test="req.rectificationStatus != null"> |
| | | and rectification_status = #{req.rectificationStatus} |
| | | </if> |
| | | <if test="req.hazardDescription != null and req.hazardDescription != ''"> |
| | | and hazard_description like concat('%', #{req.hazardDescription}, '%') |
| | | </if> |
| | | <if test="req.equipmentId != null"> |
| | | and equipment_id = #{req.equipmentId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |