代码找回

master
wany 2024-07-09 09:39:21 +08:00
parent a9ae0cfb44
commit 1a448988d3
23 changed files with 339 additions and 609 deletions

View File

@ -1,63 +0,0 @@
package com.gunshi.project.xyt.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.model.FileDescriptor;
import com.gunshi.project.xyt.service.FileDescriptorService;
import com.gunshi.project.xyt.validate.markers.Insert;
import com.gunshi.project.xyt.validate.markers.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
/**
* :
* author: xusan
* date: 2024-07-08 17:40:37
*/
@Tag(name = "文件信息")
@RestController
@RequestMapping(value="/fileDescriptor")
public class FileDescriptorController {
@Autowired
private FileDescriptorService service;
@Operation(summary = "新增")
@PostMapping("/insert")
public R<FileDescriptor> insert(@Validated(Insert.class) @RequestBody FileDescriptor dto) {
boolean result = service.save(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "修改")
@PostMapping("/update")
public R<FileDescriptor> update(@Validated(Update.class) @RequestBody FileDescriptor dto) {
boolean result = service.updateById(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "删除")
@GetMapping("/del/{id}")
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
return R.ok(service.removeById(id));
}
@Operation(summary = "列表")
@PostMapping("/list")
public R<List<FileDescriptor>> list() {
return R.ok(service.lambdaQuery().list());
}
@Operation(summary = "分页")
@PostMapping("/page")
public R<List<FileDescriptor>> page() {
return R.ok(service.page(null,null));
}
}

View File

@ -1,11 +1,21 @@
package com.gunshi.project.xyt.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.core.annotation.Get;
import com.gunshi.core.annotation.Post;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.entity.so.RescueTeamPageSo;
import com.gunshi.project.xyt.entity.vo.RescueTeamVo;
import com.gunshi.project.xyt.model.RescueTeamB;
import com.gunshi.project.xyt.service.RescueTeamBService;
import com.gunshi.project.xyt.validate.markers.Insert;
import com.gunshi.project.xyt.validate.markers.Update;
import io.swagger.v3.oas.annotations.Operation;
import com.gunshi.project.xyt.model.RescueTeamBAutoMapper;
import com.gunshi.project.xyt.model.RescueTeamFile;
import com.gunshi.project.xyt.model.RescueTeamFileAutoDao;
import com.gunshi.project.xyt.service.AbstractModelWithAttachService;
import com.gunshi.project.xyt.service.RescueTeamService;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* :
@ -21,43 +32,96 @@ import java.util.List;
*/
@Tag(name = "抢险队伍")
@RestController
@RequestMapping(value="/rescueTeamB")
public class RescueTeamBController {
@RequestMapping("/rescue/team")
public class RescueTeamBController extends AbstractCommonFileController implements
ICommonInsertWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.xyt.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.xyt.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
ICommonUpdateByIdWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.xyt.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.xyt.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
ICommonDeleteByIdWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.xyt.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.xyt.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
ICommonQueryAttach<RescueTeamFile, Long, com.gunshi.project.xyt.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>
{
@Autowired
private RescueTeamBService service;
private RescueTeamBAutoMapper rescueTeamBAutoMapper;
@Autowired
private RescueTeamFileAutoDao attachAutoDao;
@Autowired
private RescueTeamService rescueTeamService;
@Operation(summary = "新增")
@PostMapping("/insert")
public R<RescueTeamB> insert(@Validated(Insert.class) @RequestBody RescueTeamB dto) {
boolean result = service.save(dto);
return R.ok(result ? dto : null);
@Override
public Long getId(Serializable id) {
return Long.valueOf(id.toString());
}
@Operation(summary = "修改")
@PostMapping("/update")
public R<RescueTeamB> update(@Validated(Update.class) @RequestBody RescueTeamB dto) {
boolean result = service.updateById(dto);
return R.ok(result ? dto : null);
@Override
public void customSetFieldForUpdate(RescueTeamB model) {
model.setTm(new Date());
rescueTeamService.updateDetailAndObj(model);
}
@Operation(summary = "删除")
@GetMapping("/del/{id}")
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
return R.ok(service.removeById(id));
@Override
public AbstractModelWithAttachService<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.xyt.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.xyt.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao> getModelService() {
return rescueTeamService;
}
@Operation(summary = "列表")
@PostMapping("/list")
public R<List<RescueTeamB>> list() {
return R.ok(service.lambdaQuery().list());
@Override
public void customSetFieldForInsert(RescueTeamB model) {
long teamId = IdWorker.getId();
model.setTeamId(teamId);
model.setTm(new Date());
rescueTeamService.saveDetailAndObj(model,teamId);
}
@Operation(summary = "分页")
@PostMapping("/page")
public R<List<RescueTeamB>> page() {
return R.ok(service.page(null,null));
@Override
public String getGroupId() {
return "rescueTeamB";
}
}
/**
* -
*/
@Post(path = "/page/query", summary = "防汛准备-分页查询")
public R<Page<RescueTeamVo>> pageQuery(@RequestBody @Validated RescueTeamPageSo RescueTeamPageSo) {
return R.ok(rescueTeamService.pageQuery(RescueTeamPageSo));
}
/**
*
*/
@Get(path = "/list", summary = "列表查询")
public R<List<RescueTeamB>> list(@Schema(name = "teamName",description = "队伍名称") @RequestParam(name = "teamName",required = false) String teamName) {
LambdaQueryWrapper<RescueTeamB> queryWrapper = Wrappers.lambdaQuery();
if(StringUtils.isNotEmpty(teamName)){
queryWrapper.like(RescueTeamB::getTeamName,teamName);
}
return R.ok(rescueTeamBAutoMapper.selectList(queryWrapper));
}
/**
*
*/
@Get(path = "/detail", summary = "详情")
public R<RescueTeamB> detail(@Schema(name = "teamId",description = "队伍ID") @RequestParam(name = "teamId") Long teamId) {
return R.ok(rescueTeamService.detail(teamId));
}
@Get(path ="/delete/{id}", summary = "删除")
public R<Boolean> delete(@Schema(name = "teamId") @PathVariable("teamId") Long teamId) {
return R.ok(rescueTeamService.delete(teamId));
}
@Override
public RescueTeamFileAutoDao getAttachAutoDao() {
return attachAutoDao;
}
@Override
public String getAttachBzIdName() {
return "team_id";
}
}

View File

@ -1,63 +0,0 @@
package com.gunshi.project.xyt.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.model.RescueTeamDetail;
import com.gunshi.project.xyt.service.RescueTeamDetailService;
import com.gunshi.project.xyt.validate.markers.Insert;
import com.gunshi.project.xyt.validate.markers.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
/**
* :
* author: xusan
* date: 2024-07-08 17:40:37
*/
@Tag(name = "抢险队伍明细")
@RestController
@RequestMapping(value="/rescueTeamDetail")
public class RescueTeamDetailController {
@Autowired
private RescueTeamDetailService service;
@Operation(summary = "新增")
@PostMapping("/insert")
public R<RescueTeamDetail> insert(@Validated(Insert.class) @RequestBody RescueTeamDetail dto) {
boolean result = service.save(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "修改")
@PostMapping("/update")
public R<RescueTeamDetail> update(@Validated(Update.class) @RequestBody RescueTeamDetail dto) {
boolean result = service.updateById(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "删除")
@GetMapping("/del/{id}")
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
return R.ok(service.removeById(id));
}
@Operation(summary = "列表")
@PostMapping("/list")
public R<List<RescueTeamDetail>> list() {
return R.ok(service.lambdaQuery().list());
}
@Operation(summary = "分页")
@PostMapping("/page")
public R<List<RescueTeamDetail>> page() {
return R.ok(service.page(null,null));
}
}

View File

@ -1,63 +0,0 @@
package com.gunshi.project.xyt.controller;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.model.RescueTeamFile;
import com.gunshi.project.xyt.service.RescueTeamFileService;
import com.gunshi.project.xyt.validate.markers.Insert;
import com.gunshi.project.xyt.validate.markers.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
/**
* : -
* author: xusan
* date: 2024-07-08 17:40:37
*/
@Tag(name = "抢险队伍-附件")
@RestController
@RequestMapping(value="/rescueTeamFile")
public class RescueTeamFileController {
@Autowired
private RescueTeamFileService service;
@Operation(summary = "新增")
@PostMapping("/insert")
public R<RescueTeamFile> insert(@Validated(Insert.class) @RequestBody RescueTeamFile dto) {
boolean result = service.save(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "修改")
@PostMapping("/update")
public R<RescueTeamFile> update(@Validated(Update.class) @RequestBody RescueTeamFile dto) {
boolean result = service.updateById(dto);
return R.ok(result ? dto : null);
}
@Operation(summary = "删除")
@GetMapping("/del/{id}")
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
return R.ok(service.removeById(id));
}
@Operation(summary = "列表")
@PostMapping("/list")
public R<List<RescueTeamFile>> list() {
return R.ok(service.lambdaQuery().list());
}
@Operation(summary = "分页")
@PostMapping("/page")
public R<List<RescueTeamFile>> page() {
return R.ok(service.page(null,null));
}
}

View File

@ -1,8 +1,17 @@
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.project.xyt.entity.so.DataQueryCommonSo;
import com.gunshi.project.xyt.entity.vo.AttResBaseVo;
import com.gunshi.project.xyt.entity.vo.AttResMonitorVo;
import com.gunshi.project.xyt.model.AttResBase;
import com.gunshi.project.xyt.model.StImgRReal;
import com.gunshi.project.xyt.model.StRsvrR;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* :
@ -11,5 +20,65 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface AttResBaseMapper extends BaseMapper<AttResBase> {
@Select("""
<script>
select t.stcd,t.stnm,COALESCE(t.clgtd,t.lgtd) lgtd,COALESCE(t.clttd,t.lttd) lttd,t.source,t.sttp,t.stlc,t.adcd,t.esstym,s.res_code,s.fl_low_lim_lev,
s.tot_cap,s.ben_res_cap,s.norm_wat_lev,s.crest_elev,s.des_flood_lev,s.dead_lev,s.cal_flood_lev,sad.adnm,
m.tm,m.rz,(m.rz-s.fl_low_lim_lev) as aFsltdz,sprr.tm as drpTm,sprr.h1,sprr.h3,sprr.h6,sprr.h12,sprr.h24,sprr.today,
case when s.cal_flood_lev is not null and m.rz-s.cal_flood_lev &gt; 0 then 1 else 0 end as calState,
case when s.des_flood_lev is not null and m.rz-s.des_flood_lev &gt; 0 then 1 else 0 end as desState,
case when s.fl_low_lim_lev is not null and m.rz-s.fl_low_lim_lev &gt; 0 then 1 else 0 end as flState
from public.st_stbprp_b t
left join public.att_res_base s on t.stcd = s.stcd
left join public.st_addvcd_d sad on t.adcd = sad.adcd
left join public.st_rsvr_r_real m on t.stcd = m.stcd
left join public.st_pptn_r_real sprr on t.stcd = sprr.stcd
where t.sttp = 'RR'
order by aFsltdz desc nulls last
</script>
""")
List<AttResBaseVo> queryList();
@Select("""
<script>
select t.stcd,t.tm,t.drp from public.st_pptn_r t
where t.stcd = #{obj.stcd}
and t.tm <![CDATA[>=]]> to_timestamp(#{obj.stm},'YYYY-MM-DD HH24:MI:SS')
and t.tm <![CDATA[<=]]> to_timestamp(#{obj.etm},'YYYY-MM-DD HH24:MI:SS')
order by t.tm desc
</script>
""")
List<AttResMonitorVo> drpData(@Param("obj") DataQueryCommonSo dataQueryCommonSo);
@Select("""
<script>
select t.stcd,t.tm,t.rz from public.st_rsvr_r t
where t.stcd = #{obj.stcd}
and t.tm <![CDATA[>=]]> to_timestamp(#{obj.stm},'YYYY-MM-DD HH24:MI:SS')
and t.tm <![CDATA[<=]]> to_timestamp(#{obj.etm},'YYYY-MM-DD HH24:MI:SS')
and TRIM(TO_CHAR(t.tm, 'MI:SS')) = '00:00'
order by t.tm desc
</script>
""")
List<AttResMonitorVo> rzData(@Param("obj") DataQueryCommonSo dataQueryCommonSo);
@Select("""
<script>
select t.stcd,t.tm,t.img_path from public.st_img_r_real t
where t.stcd in (select stcd from public.st_stbprp_b where res_code = #{resCode}
and sttp = 'TX')
</script>
""")
List<StImgRReal> realImg(@Param("resCode") String resCode);
@Select("""
<script>
select t.stcd,t.tm,t.rz from public.st_rsvr_r t
where t.stcd = #{stcd}
and t.tm <![CDATA[>=]]> to_timestamp(#{stm},'YYYY-MM-DD HH24:MI:SS')
and t.tm <![CDATA[<=]]> to_timestamp(#{etm},'YYYY-MM-DD HH24:MI:SS')
order by t.tm desc
</script>
""")
List<StRsvrR> queryRzList(@Param("stcd") String stcd, @Param("stm") String startTime, @Param("etm") String endTime);
}

View File

@ -1,15 +0,0 @@
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.project.xyt.model.FileDescriptor;
import org.apache.ibatis.annotations.Mapper;
/**
* :
* author: xusan
* date: 2024-07-08 15:44:07
*/
@Mapper
public interface FileDescriptorMapper extends BaseMapper<FileDescriptor> {
}

View File

@ -1,8 +1,13 @@
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.xyt.entity.so.RescueTeamPageSo;
import com.gunshi.project.xyt.entity.vo.RescueTeamVo;
import com.gunshi.project.xyt.model.RescueTeamB;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* :
@ -11,5 +16,26 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface RescueTeamBMapper extends BaseMapper<RescueTeamB> {
@Select("""
<script>
with m1 as (
select distinct t2.* from public.rescue_team_b t2
<where>
<if test="obj.teamName != null and obj.teamName !=''">
and t2.team_name LIKE concat('%',#{obj.teamName},'%')
</if>
<if test="obj.dateSo != null and obj.dateSo.start != null">
and t2.valid_end_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t2.valid_end_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
),
m2 as (select team_id,count(team_id) as personCount from rescue_team_detail GROUP BY team_id)
select m1.*,m2.personCount,case when m1.valid_end_date <![CDATA[<]]> now() then 0 else 1 end as isValid from m1 left join m2 on m1.team_id = m2.team_id
order by m1.register_date desc
</script>
""")
Page<RescueTeamVo> pageQuery(@Param("page") Page<RescueTeamVo> page, @Param("obj") RescueTeamPageSo rescueTeamPageSo);
}

View File

@ -1,8 +1,13 @@
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.file.model.FileDescriptor;
import com.gunshi.project.xyt.model.RescueTeamFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* : -
@ -11,5 +16,11 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface RescueTeamFileMapper extends BaseMapper<RescueTeamFile> {
@Select("""
<script>
select * from public.file_descriptor
where file_id in (select file_id from public.rescue_team_file where team_id = #{teamId})
</script>
""")
List<FileDescriptor> queryFiles(@Param("teamId") Long teamId);
}

View File

@ -1,42 +0,0 @@
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.xyt.entity.so.RescueTeamPageSo;
import com.gunshi.project.xyt.entity.vo.RescueTeamVo;
import com.gunshi.project.xyt.model.RescueTeamB;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface RescueTeamMapper extends BaseMapper<RescueTeamB> {
@Select("""
<script>
with m1 as (
select distinct t2.* from public.rescue_team_b t2
<where>
<if test="obj.teamName != null and obj.teamName !=''">
and t2.team_name LIKE concat('%',#{obj.teamName},'%')
</if>
<if test="obj.dateSo != null and obj.dateSo.start != null">
and t2.valid_end_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t2.valid_end_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
),
m2 as (select team_id,count(team_id) as personCount from rescue_team_detail GROUP BY team_id)
select m1.*,m2.personCount,case when m1.valid_end_date <![CDATA[<]]> now() then 0 else 1 end as isValid from m1 left join m2 on m1.team_id = m2.team_id
order by m1.register_date desc
</script>
""")
Page<RescueTeamVo> pageQuery(@Param("page") Page<RescueTeamVo> page, @Param("obj") RescueTeamPageSo rescueTeamPageSo);
}

View File

@ -3,6 +3,11 @@ package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.project.xyt.model.StPptnR;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.Date;
/**
* :
@ -11,5 +16,15 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StPptnRMapper extends BaseMapper<StPptnR> {
@Select("""
<script>
with m1 as (
select stcd,drp from public.st_pptn_r qxt WHERE
tm &gt; #{startTime} and tm &lt;= #{endTime})
select SUM(m1.drp) as sumdrp FROM m1
GROUP BY m1.stcd
HAVING m1.stcd = #{stcd}
</script>
""")
BigDecimal queryStPptnTimeQuantumByStcdAndTime(@Param("stcd") String stcd, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@ -13,6 +13,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -155,8 +156,7 @@ public class AttResBase implements Serializable {
*/
@TableField(value="fl_low_lim_lev")
@Schema(description="主汛期防洪限制水位")
@Size(max = 0,message = "主汛期防洪限制水位最大长度要小于 0")
private String flLowLimLev;
private BigDecimal flLowLimLev;
/**
*

View File

@ -1,110 +0,0 @@
package com.gunshi.project.xyt.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gunshi.core.dateformat.DateFormatString;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:34:26
*/
@Schema(description="文件信息")
@Data
@TableName("public.file_descriptor")
public class FileDescriptor implements Serializable {
private static final long serialVersionUID = 1L;
/**
* idminioetag32
*/
@TableId(value="file_id", type= IdType.AUTO)
@Schema(description="文件idminio的etag是32位")
@Size(max = 0,message = "文件idminio的etag是32位最大长度要小于 0")
@NotBlank(message = "文件idminio的etag是32位不能为空")
private Long fileId;
/**
*
*/
@TableField(value="business_type")
@Schema(description="业务类型编码")
@Size(max = 32,message = "业务类型编码最大长度要小于 32")
private String businessType;
/**
* id
*/
@TableField(value="group_id")
@Schema(description="文件组id")
@Size(max = 32,message = "文件组id最大长度要小于 32")
private String groupId;
/**
* 访
*/
@TableField(value="access_group")
@Schema(description="访问组")
@Size(max = 16,message = "访问组最大长度要小于 16")
@NotBlank(message = "访问组不能为空")
private String accessGroup;
/**
* userId
*/
@TableField(value="user_id")
@Schema(description="上传者userId")
@Size(max = 0,message = "上传者userId最大长度要小于 0")
@NotBlank(message = "上传者userId不能为空")
private Long userId;
/**
* minio
*/
@TableField(value="file_path")
@Schema(description="文件路径minio会按全路径保存")
@Size(max = 255,message = "文件路径minio会按全路径保存最大长度要小于 255")
@NotBlank(message = "文件路径minio会按全路径保存不能为空")
private String filePath;
/**
*
*/
@TableField(value="file_name")
@Schema(description="文件名称")
@Size(max = 255,message = "文件名称最大长度要小于 255")
@NotBlank(message = "文件名称不能为空")
private String fileName;
/**
*
*/
@TableField(value="file_size")
@Schema(description="文件长度")
@Size(max = 0,message = "文件长度最大长度要小于 0")
@NotBlank(message = "文件长度不能为空")
private Long fileSize;
/**
*
*/
@TableField(value="upload_time")
@Schema(description="上传时间")
@Size(max = 0,message = "上传时间最大长度要小于 0")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date uploadTime;
}

View File

@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gunshi.core.dateformat.DateFormatString;
import com.gunshi.file.model.FileDescriptor;
import com.gunshi.project.xyt.service.AbstractModelWithAttachService;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
@ -14,6 +16,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* :
@ -23,7 +26,7 @@ import java.util.Date;
@Schema(description="抢险队伍")
@Data
@TableName("public.rescue_team_b")
public class RescueTeamB implements Serializable {
public class RescueTeamB implements Serializable, AbstractModelWithAttachService.GetFileIds {
private static final long serialVersionUID = 1L;
@ -130,4 +133,22 @@ public class RescueTeamB implements Serializable {
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date tm;
@TableField(exist = false)
@Schema(description = "文件id集合")
private List<String> fileIds;
/**
*
*/
@Schema(description="文件上传数据")
@TableField(exist = false)
private List<FileDescriptor> files;
/**
*
*/
@Schema(description="队伍明细")
@TableField(exist = false)
private List<RescueTeamDetail> details;
}

View File

@ -1,84 +1,77 @@
package com.gunshi.project.xyt.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import com.gunshi.core.dateformat.DateFormatString;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:34:26
*/
@Schema(description="图像历史表")
@Schema
@Data
@TableName("public.st_img_r")
@TableName(value = "st_img_r")
public class StImgR implements Serializable {
private static final long serialVersionUID = 1L;
/**
* stcd
*/
@TableId(value="stcd", type= IdType.AUTO)
@Schema(description="stcd")
@Size(max = 20,message = "stcd最大长度要小于 20")
@NotBlank(message = "stcd不能为空")
@TableField(value = "stcd")
@MppMultiId
@Schema(description="")
@Size(max = 20,message = "最大长度要小于 20")
@NotBlank(message = "不能为空")
private String stcd;
/**
* tm
*/
@TableId(value="tm", type= IdType.AUTO)
@Schema(description="tm")
@Size(max = 0,message = "tm最大长度要小于 0")
@NotBlank(message = "tm不能为空")
@MppMultiId
@TableField(value = "tm")
@Schema(description="")
@NotNull(message = "不能为null")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date tm;
/**
* img_path
*/
@TableField(value="img_path")
@Schema(description="img_path")
@Size(max = 256,message = "img_path最大长度要小于 256")
@NotBlank(message = "img_path不能为空")
@TableField(value = "chtm")
@Schema(description="")
@NotNull(message = "不能为null")
private Date chtm;
@TableField(value = "img_path")
@Schema(description="")
@Size(max = 256,message = "最大长度要小于 256")
@NotBlank(message = "不能为空")
private String imgPath;
/**
* chid
*/
@TableField(value="chid")
@Schema(description="chid")
@Size(max = 10,message = "chid最大长度要小于 10")
@NotBlank(message = "chid不能为空")
@TableField(value = "chid")
@Schema(description="")
@Size(max = 10,message = "最大长度要小于 10")
@NotBlank(message = "不能为空")
private String chid;
/**
* source
*/
@TableField(value="source")
@Schema(description="source")
@Size(max = 50,message = "source最大长度要小于 50")
@TableField(value = "\"source\"")
@Schema(description="")
@Size(max = 50,message = "最大长度要小于 50")
private String source;
/**
* mtmcd
*/
@TableField(value="mtmcd")
@Schema(description="mtmcd")
@Size(max = 20,message = "mtmcd最大长度要小于 20")
@TableField(value = "mtmcd")
@Schema(description="")
@Size(max = 20,message = "最大长度要小于 20")
private String mtmcd;
private static final long serialVersionUID = 1L;
public static final String COL_STCD = "stcd";
public static final String COL_TM = "tm";
public static final String COL_CHTM = "chtm";
public static final String COL_IMG_PATH = "img_path";
public static final String COL_CHID = "chid";
public static final String COL_SOURCE = "source";
public static final String COL_MTMCD = "mtmcd";
}

View File

@ -1,76 +1,67 @@
package com.gunshi.project.xyt.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gunshi.core.dateformat.DateFormatString;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:34:26
*/
@Schema(description="图像表")
@Schema
@Data
@TableName("public.st_img_r_real")
@TableName(value = "st_img_r_real")
public class StImgRReal implements Serializable {
@TableField(value = "stcd")
@MppMultiId
@Schema(description="")
@Size(max = 20,message = "最大长度要小于 20")
@NotBlank(message = "不能为空")
private String stcd;
@TableField(value = "tm")
@MppMultiId
@Schema(description="")
@NotNull(message = "不能为null")
private Date tm;
@TableField(value = "chtm")
@Schema(description="")
@NotNull(message = "不能为null")
private Date chtm;
@TableField(value = "img_path")
@Schema(description="")
@Size(max = 256,message = "最大长度要小于 256")
@NotBlank(message = "不能为空")
private String imgPath;
@TableField(value = "chid")
@Schema(description="")
@Size(max = 10,message = "最大长度要小于 10")
@NotBlank(message = "不能为空")
private String chid;
@TableField(value = "\"source\"")
@Schema(description="")
@Size(max = 50,message = "最大长度要小于 50")
private String source;
private static final long serialVersionUID = 1L;
/**
* stcd
*/
@TableId(value="stcd", type= IdType.AUTO)
@Schema(description="stcd")
@Size(max = 32,message = "stcd最大长度要小于 32")
@NotBlank(message = "stcd不能为空")
private String stcd;
public static final String COL_STCD = "stcd";
/**
* tm
*/
@TableField(value="tm")
@Schema(description="tm")
@Size(max = 0,message = "tm最大长度要小于 0")
@NotBlank(message = "tm不能为空")
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
private Date tm;
public static final String COL_TM = "tm";
/**
* img_path
*/
@TableField(value="img_path")
@Schema(description="img_path")
@Size(max = 256,message = "img_path最大长度要小于 256")
@NotBlank(message = "img_path不能为空")
private String imgPath;
public static final String COL_CHTM = "chtm";
/**
* chid
*/
@TableId(value="chid", type= IdType.AUTO)
@Schema(description="chid")
@Size(max = 10,message = "chid最大长度要小于 10")
@NotBlank(message = "chid不能为空")
private String chid;
public static final String COL_IMG_PATH = "img_path";
/**
* source
*/
@TableField(value="source")
@Schema(description="source")
@Size(max = 50,message = "source最大长度要小于 50")
private String source;
public static final String COL_CHID = "chid";
public static final String COL_SOURCE = "source";
}

View File

@ -520,4 +520,6 @@ public class StStbprpB implements Serializable {
@Size(max = 0,message = "测站状态 0无效 1有效最大长度要小于 0")
private Integer status;
public static final String COL_STCD = "stcd";
}

View File

@ -13,6 +13,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -61,18 +62,16 @@ public class StZvarlB implements Serializable {
*/
@TableField(value="rz")
@Schema(description="库水位")
@Size(max = 0,message = "库水位最大长度要小于 0")
@NotBlank(message = "库水位不能为空")
private String rz;
private BigDecimal rz;
/**
*
*/
@TableField(value="w")
@Schema(description="蓄水量")
@Size(max = 0,message = "蓄水量最大长度要小于 0")
@NotBlank(message = "蓄水量不能为空")
private String w;
private BigDecimal w;
/**
*

View File

@ -1,25 +0,0 @@
package com.gunshi.project.xyt.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.xyt.mapper.FileDescriptorMapper;
import com.gunshi.project.xyt.model.FileDescriptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:30:37
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class FileDescriptorService extends ServiceImpl<FileDescriptorMapper, FileDescriptor>
{
}

View File

@ -1,25 +0,0 @@
package com.gunshi.project.xyt.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.xyt.mapper.RescueTeamBMapper;
import com.gunshi.project.xyt.model.RescueTeamB;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:30:38
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class RescueTeamBService extends ServiceImpl<RescueTeamBMapper, RescueTeamB>
{
}

View File

@ -1,25 +0,0 @@
package com.gunshi.project.xyt.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.xyt.mapper.RescueTeamDetailMapper;
import com.gunshi.project.xyt.model.RescueTeamDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* :
* author: xusan
* date: 2024-07-08 17:30:38
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class RescueTeamDetailService extends ServiceImpl<RescueTeamDetailMapper, RescueTeamDetail>
{
}

View File

@ -1,25 +0,0 @@
package com.gunshi.project.xyt.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.xyt.mapper.RescueTeamFileMapper;
import com.gunshi.project.xyt.model.RescueTeamFile;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* : -
* author: xusan
* date: 2024-07-08 17:30:38
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class RescueTeamFileService extends ServiceImpl<RescueTeamFileMapper, RescueTeamFile>
{
}

View File

@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.xyt.entity.so.RescueTeamPageSo;
import com.gunshi.project.xyt.entity.vo.RescueTeamVo;
import com.gunshi.project.xyt.mapper.RescueTeamBMapper;
import com.gunshi.project.xyt.mapper.RescueTeamFileMapper;
import com.gunshi.project.xyt.mapper.RescueTeamMapper;
import com.gunshi.project.xyt.model.RescueTeamB;
import com.gunshi.project.xyt.model.RescueTeamDetail;
import com.gunshi.project.xyt.model.RescueTeamFile;
@ -44,7 +44,7 @@ public class RescueTeamService extends AbstractModelWithAttachService<RescueTeam
@Resource
private RescueTeamMapper rescueTeamMapper;
private RescueTeamBMapper rescueTeamMapper;
@Resource
private RescueTeamFileMapper rescueTeamFileMapper;

View File

@ -1,5 +0,0 @@
<?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.gunshi.project.xyt.mapper.FileDescriptorMapper">
</mapper>