7 changed files with 232 additions and 2 deletions
@ -0,0 +1,12 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.entity.ComplaintCollectionFile; |
||||||
|
import com.biutag.supervision.repository.base.HBaseMapper; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface ComplaintCollectionFileMapper extends HBaseMapper<ComplaintCollectionFile> { |
||||||
|
|
||||||
|
int insertBatch(List<ComplaintCollectionFile> list); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,49 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
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 io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ComplaintCollectionFile |
||||||
|
* @Description 涉访涉诉附件表 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/31 15:09 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "涉访涉诉附件表") |
||||||
|
@TableName("complaint_collection_file") |
||||||
|
public class ComplaintCollectionFile { |
||||||
|
|
||||||
|
@Schema(description = "附件ID") |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@Schema(description = "关联 complaint_collection 主键ID") |
||||||
|
@TableField("complaint_id") |
||||||
|
private String complaintId; |
||||||
|
|
||||||
|
@Schema(description = "文件路径") |
||||||
|
@TableField("file_path") |
||||||
|
private String filePath; |
||||||
|
|
||||||
|
@Schema(description = "文件名称") |
||||||
|
@TableField("file_name") |
||||||
|
private String fileName; |
||||||
|
|
||||||
|
@Schema(description = "创建人") |
||||||
|
@TableField("create_by") |
||||||
|
private String createBy; |
||||||
|
|
||||||
|
@Schema(description = "创建时间") |
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,56 @@ |
|||||||
|
package com.biutag.supervision.pojo.param.complaintCollectionFile; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ComplaintCollectionFileQueryParam |
||||||
|
* @Description 涉访涉诉附件表查询实体 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/31 15:19 |
||||||
|
*/ |
||||||
|
|
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "涉访涉诉附件表查询实体") |
||||||
|
public class ComplaintCollectionFileQueryParam { |
||||||
|
|
||||||
|
@Schema(description = "id") |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@Schema(description = "ids") |
||||||
|
private Set<Long> ids; |
||||||
|
|
||||||
|
@Schema(description = "关联complaint_collection主键ID") |
||||||
|
private String complaintId; |
||||||
|
|
||||||
|
@Schema(description = "complaintIds") |
||||||
|
private Set<String> complaintIds; |
||||||
|
|
||||||
|
@Schema(description = "文件名称") |
||||||
|
@TableField("fileName") |
||||||
|
private String fileName; |
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "文件路径") |
||||||
|
@TableField("filePath") |
||||||
|
private String filePath; |
||||||
|
|
||||||
|
@Schema(description = "创建人(新表字段)") |
||||||
|
@TableField("create_by") |
||||||
|
private String createBy; |
||||||
|
|
||||||
|
@Schema(description = "创建时间(新表字段)") |
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,60 @@ |
|||||||
|
package com.biutag.supervision.repository.complaintCollectionFile; |
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
||||||
|
import com.biutag.supervision.mapper.ComplaintCollectionFileMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.ComplaintCollectionFile; |
||||||
|
import com.biutag.supervision.pojo.param.complaintCollectionFile.ComplaintCollectionFileQueryParam; |
||||||
|
import com.biutag.supervision.repository.base.BaseDAO; |
||||||
|
import jakarta.annotation.Resource; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.function.Function; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName ComplaintCollectionFileResourceService |
||||||
|
* @Description 涉访涉诉附件资源层 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/31 15:08 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class ComplaintCollectionFileResourceService extends BaseDAO { |
||||||
|
|
||||||
|
|
||||||
|
@Resource |
||||||
|
private ComplaintCollectionFileMapper complaintCollectionFileMapper; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<ComplaintCollectionFile> query(ComplaintCollectionFileQueryParam param) { |
||||||
|
LambdaQueryWrapper<ComplaintCollectionFile> qw = new LambdaQueryWrapper<>(); |
||||||
|
setBatchQuery(param.getId(), param.getIds(), qw, ComplaintCollectionFile::getId); |
||||||
|
setBatchQuery(param.getComplaintId(), param.getComplaintIds(), qw, ComplaintCollectionFile::getComplaintId); |
||||||
|
qw.eq(StrUtil.isNotBlank(param.getFileName()), ComplaintCollectionFile::getFileName, param.getFileName()); |
||||||
|
qw.eq(StrUtil.isNotBlank(param.getFilePath()), ComplaintCollectionFile::getFilePath, param.getFilePath()); |
||||||
|
return complaintCollectionFileMapper.selectList(qw); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public Map<String, List<ComplaintCollectionFile>> queryGroupBy(ComplaintCollectionFileQueryParam param, Function<ComplaintCollectionFile, String> groupBy) { |
||||||
|
List<ComplaintCollectionFile> users = query(param); |
||||||
|
if (CollectionUtils.isEmpty(users)) { |
||||||
|
return new HashMap<>(); |
||||||
|
} |
||||||
|
return users.stream().collect(Collectors.groupingBy(groupBy)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public Boolean createComplaintCollectionFile(List<ComplaintCollectionFile> complaintCollectionFiles) { |
||||||
|
innerBatchInsert(complaintCollectionFileMapper, complaintCollectionFiles, "添加失败!"); |
||||||
|
return Boolean.TRUE; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
<?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.biutag.supervision.mapper.ComplaintCollectionFileMapper"> |
||||||
|
|
||||||
|
<insert id="insertBatch" parameterType="java.util.List"> |
||||||
|
INSERT INTO complaint_collection_file ( |
||||||
|
id, |
||||||
|
complaint_id, |
||||||
|
file_path, |
||||||
|
file_name, |
||||||
|
create_by, |
||||||
|
create_time |
||||||
|
) |
||||||
|
VALUES |
||||||
|
<foreach collection="list" item="item" separator=","> |
||||||
|
( |
||||||
|
#{item.id}, |
||||||
|
#{item.complaintId}, |
||||||
|
#{item.filePath}, |
||||||
|
#{item.fileName}, |
||||||
|
#{item.createBy}, |
||||||
|
#{item.createTime} |
||||||
|
) |
||||||
|
</foreach> |
||||||
|
</insert> |
||||||
|
|
||||||
|
</mapper> |
||||||
Loading…
Reference in new issue