فهرست منبع

统计报表相关功能

zhonghui 3 سال پیش
والد
کامیت
f8043e48cb

+ 23 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/dto/StatisticReportDto.java

@@ -0,0 +1,23 @@
+package com.boman.domain.dto;
+
+public class StatisticReportDto {
+    private String id;
+
+    private String name;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 124 - 22
boman-api/boman-domain/src/main/java/com/boman/domain/entity/StatisticReport.java

@@ -1,27 +1,129 @@
 package com.boman.domain.entity;
 
-import lombok.Builder;
-import lombok.Data;
-
-@Data
-@Builder
-public class StatisticReport {
-
-  private Long id;
-  private String reportName;
-  private String reportId;
-  private String templateName;
-  private java.sql.Date startTime;
-  private java.sql.Date endTime;
-  private String reportStatus;
-  private String status;
-  private String repUploadFile;
-  private String remark;
-  private String createBy;
-  private java.sql.Timestamp createTime;
-  private String updateBy;
-  private java.sql.Timestamp updateTime;
-  private String isDel;
+import com.boman.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
 
+import java.sql.Date;
+import java.util.List;
 
+public class StatisticReport extends BaseEntity {
+
+    private Long id;
+    private String reportName;
+    private String reportId;
+    private String templateName;
+    private Date startTime;
+    private Date endTime;
+    private String sTime;
+    private String eTime;
+    private String reportStatus;
+    private String status;
+    private String repUploadFile;
+    private String isDel;
+    private List<StatisticReportPersonnel> personnels;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getReportName() {
+        return reportName;
+    }
+
+    public void setReportName(String reportName) {
+        this.reportName = reportName;
+    }
+
+    public String getReportId() {
+        return reportId;
+    }
+
+    public void setReportId(String reportId) {
+        this.reportId = reportId;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+
+    public void setTemplateName(String templateName) {
+        this.templateName = templateName;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getReportStatus() {
+        return reportStatus;
+    }
+
+    public void setReportStatus(String reportStatus) {
+        this.reportStatus = reportStatus;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getRepUploadFile() {
+        return repUploadFile;
+    }
+
+    public void setRepUploadFile(String repUploadFile) {
+        this.repUploadFile = repUploadFile;
+    }
+
+    public List<StatisticReportPersonnel> getPersonnels() {
+        return personnels;
+    }
+
+    public void setPersonnels(List<StatisticReportPersonnel> personnels) {
+        this.personnels = personnels;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    public String getsTime() {
+        return sTime;
+    }
+
+    public void setsTime(String sTime) {
+        this.sTime = sTime;
+    }
+
+    public String geteTime() {
+        return eTime;
+    }
+
+    public void seteTime(String eTime) {
+        this.eTime = eTime;
+    }
 }

+ 76 - 7
boman-api/boman-domain/src/main/java/com/boman/domain/entity/StatisticReportPersonnel.java

@@ -1,11 +1,13 @@
 package com.boman.domain.entity;
 
+import com.boman.domain.BaseEntity;
 import lombok.Builder;
 import lombok.Data;
 
-@Data
-@Builder
-public class StatisticReportPersonnel {
+import java.util.Date;
+import java.util.List;
+
+public class StatisticReportPersonnel  extends BaseEntity {
 
   private Long id;
   private String reportName;
@@ -16,9 +18,76 @@ public class StatisticReportPersonnel {
   private String userName;
   private String isDel;
   private String status;
-  private String createBy;
-  private java.sql.Timestamp createTime;
-  private String updateBy;
-  private java.sql.Timestamp updateTime;
 
+  public Long getId() {
+    return id;
+  }
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public String getReportName() {
+    return reportName;
+  }
+
+  public void setReportName(String reportName) {
+    this.reportName = reportName;
+  }
+
+  public Long getStatisticId() {
+    return statisticId;
+  }
+
+  public void setStatisticId(Long statisticId) {
+    this.statisticId = statisticId;
+  }
+
+  public Long getDeptId() {
+    return deptId;
+  }
+
+  public void setDeptId(Long deptId) {
+    this.deptId = deptId;
+  }
+
+  public String getDeptName() {
+    return deptName;
+  }
+
+  public void setDeptName(String deptName) {
+    this.deptName = deptName;
+  }
+
+  public Long getUserId() {
+    return userId;
+  }
+
+  public void setUserId(Long userId) {
+    this.userId = userId;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public String getIsDel() {
+    return isDel;
+  }
+
+  public void setIsDel(String isDel) {
+    this.isDel = isDel;
+  }
+
+  public String getStatus() {
+    return status;
+  }
+
+  public void setStatus(String status) {
+    this.status = status;
+  }
 }

+ 161 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/CollectUtils.java

@@ -0,0 +1,161 @@
+package com.boman.common.core.utils;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * 集合工具类
+ *
+ * @author z.h
+ */
+public final class CollectUtils {
+
+    public static <E> List<E> newArrayList() {
+        return new ArrayList<E>();
+    }
+
+    public static <E> List<E> newArrayList(int initialCapacity) {
+        return new ArrayList<E>(initialCapacity);
+    }
+
+    public static <E> List<E> newArrayList(Collection<? extends E> c) {
+        return new ArrayList<E>(c);
+    }
+
+    public static <E> List<E> newArrayList(E... values) {
+        List<E> list = new ArrayList<E>(values.length);
+        for (E e : values) {
+            list.add(e);
+        }
+        return list;
+    }
+
+    /**
+     * 将一个集合按照固定大小查分成若干个集合。
+     *
+     * @param list
+     * @param count
+     * @return
+     */
+    public static <T> List<List<T>> split(final List<T> list, final int count) {
+        List<List<T>> subIdLists = CollectUtils.newArrayList();
+        if (list.size() < count) {
+            subIdLists.add(list);
+        } else {
+            int i = 0;
+            while (i < list.size()) {
+                int end = i + count;
+                if (end > list.size()) {
+                    end = list.size();
+                }
+                subIdLists.add(list.subList(i, end));
+                i += count;
+            }
+        }
+        return subIdLists;
+    }
+
+    public static boolean isEmpty(Collection<?> coll) {
+        return (coll == null || coll.isEmpty());
+    }
+
+    public static boolean isNotEmpty(Collection<?> coll) {
+        return null != coll && !coll.isEmpty();
+    }
+
+    public static <K, V> Map<K, V> newHashMap() {
+        return new HashMap<K, V>();
+    }
+
+    public static <K, V> Map<K, V> newConcurrentHashMap() {
+        return new ConcurrentHashMap<K, V>();
+    }
+
+    public static <E> Queue<E> newConcurrentLinkedQueue() {
+        return new ConcurrentLinkedQueue<E>();
+    }
+
+    public static <K, V> Map<K, V> newHashMap(Map<? extends K, ? extends V> m) {
+        return new HashMap<K, V>(m);
+    }
+
+    public static <K, V> Map<K, V> newLinkedHashMap(Map<? extends K, ? extends V> m) {
+        return new LinkedHashMap<K, V>(m);
+    }
+
+    public static <K, V> Map<K, V> newLinkedHashMap(int size) {
+        return new LinkedHashMap<K, V>(size);
+    }
+
+    public static <E> Set<E> newHashSet() {
+        return new HashSet<E>();
+    }
+
+    public static <E> Set<E> newHashSet(E... values) {
+        Set<E> set = new HashSet<E>(values.length);
+        for (E e : values) {
+            set.add(e);
+        }
+        return set;
+    }
+
+    public static <E> Set<E> newHashSet(Collection<? extends E> c) {
+        return new HashSet<E>(c);
+    }
+
+    public static Map<String, String> toMap(String[]... wordMappings) {
+        Map<String, String> mappings = new HashMap<String, String>();
+        for (int i = 0; i < wordMappings.length; i++) {
+            String singular = wordMappings[i][0];
+            String plural = wordMappings[i][1];
+            mappings.put(singular, plural);
+        }
+        return mappings;
+    }
+    public static <T> List<T> intersection(List<T> first, List<T> second) {
+        List<T> list = CollectUtils.newArrayList();
+        Map<T, Integer> mapa = getCardinalityMap(first), mapb = getCardinalityMap(second);
+        Set<T> elts = new HashSet<T>(first);
+        elts.addAll(second);
+        for (T obj : elts)
+            for (int i = 0, m = Math.min(getFreq(obj, mapa), getFreq(obj, mapb)); i < m; i++)
+                list.add(obj);
+        return list;
+    }
+
+    public static <T> List<T> union(List<T> first, List<T> second) {
+        Map<T, Integer> mapa = getCardinalityMap(first), mapb = getCardinalityMap(second);
+        Set<T> elts = new HashSet<T>(first);
+        elts.addAll(second);
+        List<T> list = newArrayList();
+        for (T obj : elts)
+            for (int i = 0, m = Math.max(getFreq(obj, mapa), getFreq(obj, mapb)); i < m; i++)
+                list.add(obj);
+        return list;
+
+    }
+
+    public static <T> List<T> subtract(List<T> first, List<T> second) {
+        List<T> list = newArrayList(first);
+        for (T t : second)
+            list.remove(t);
+        return list;
+    }
+
+    public static <T> Map<T, Integer> getCardinalityMap(final List<T> coll) {
+        Map<T, Integer> count = newHashMap();
+        for (Iterator<T> it = coll.iterator(); it.hasNext();) {
+            T obj = it.next();
+            Integer c = (count.get(obj));
+            if (c == null) count.put(obj, Integer.valueOf(1));
+            else count.put(obj, new Integer(c.intValue() + 1));
+        }
+        return count;
+    }
+
+    private static final <T> int getFreq(final T obj, final Map<T, Integer> freqMap) {
+        Integer count = freqMap.get(obj);
+        return (count != null) ? count.intValue() : 0;
+    }
+}

+ 13 - 4
boman-report/src/main/java/com/boman/report/controller/StatisticReportController.java

@@ -6,6 +6,8 @@ import com.boman.report.service.StatisticReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
+import com.boman.domain.entity.StatisticReport;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -15,14 +17,17 @@ public class StatisticReportController extends BaseController {
 
     @Autowired
     private StatisticReportService statisticReportService;
+    @Autowired
+    private StatisticReportService reportService;
+
     /**
      * 获取报表id集合
      *
      * @return
      */
     @RequestMapping("/datas")
-    public AjaxResult getReports() {
-        return AjaxResult.success();
+    public AjaxResult datas(@RequestBody StatisticReport report) {
+        return AjaxResult.success(reportService.datas(report));
     }
 
     /**
@@ -30,10 +35,14 @@ public class StatisticReportController extends BaseController {
      * @return
      */
     @RequestMapping("/list")
-    public AjaxResult list() {
+    public AjaxResult list(@RequestBody StatisticReport report) {
         startPage();
+        return AjaxResult.success(reportService.selectList(report));
+    }
 
-        return AjaxResult.success();
+    @RequestMapping("/saveOrUpdate")
+    public AjaxResult saveOrUpdate(@RequestBody StatisticReport report) {
+        return reportService.saveOrUpdate(report);
     }
 
 

+ 11 - 0
boman-report/src/main/java/com/boman/report/mapper/StatisticReportMapper.java

@@ -1,9 +1,13 @@
 package com.boman.report.mapper;
 
+import com.boman.domain.dto.StatisticReportDto;
+import com.boman.domain.entity.StatisticReport;
 import com.boman.domain.entity.StatisticReport;
 import com.boman.domain.entity.vo.StatisticReportVo;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * @author shiqian
  * @date 2021年08月24日 11:09
@@ -11,6 +15,13 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface StatisticReportMapper {
 
+    List<StatisticReportDto> selectReportInfo(String userName);
+
+    List<StatisticReport> selectList(StatisticReport report);
+
+    int insert(StatisticReport report);
+
+    int update(StatisticReport report);
     /**
      * 获取表报详情
      * @param id

+ 4 - 0
boman-report/src/main/java/com/boman/report/mapper/StatisticReportPersonnelMapper.java

@@ -11,5 +11,9 @@ import java.util.List;
  **/
 @Repository
 public interface StatisticReportPersonnelMapper {
+
+    int deleteByStatisticIds(List<Long> ids);
+
+    int insert(StatisticReportPersonnel personnel);
     List<StatisticReportPersonnel> selectByStatisticId(Long id);
 }

+ 8 - 0
boman-report/src/main/java/com/boman/report/service/StatisticReportPersonnelService.java

@@ -1,8 +1,16 @@
 package com.boman.report.service;
 
+import com.boman.domain.entity.StatisticReportPersonnel;
+
+import java.util.List;
+
 /**
  * @author shiqian
  * @date 2021年08月24日 11:09
  **/
 public interface StatisticReportPersonnelService {
+
+    int deleteByStatisticIds(List<Long> ids);
+
+    int insert(List<StatisticReportPersonnel> personnels);
 }

+ 22 - 1
boman-report/src/main/java/com/boman/report/service/StatisticReportService.java

@@ -1,16 +1,37 @@
 package com.boman.report.service;
 
 import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.StatisticReportDto;
+import com.boman.domain.entity.StatisticReport;
+
+import java.util.List;
+import java.util.Map;
+
+import com.boman.domain.dto.AjaxResult;
+
+import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.entity.StatisticReport;
+
+import java.util.List;
 
 /**
  * @author shiqian
  * @date 2021年08月24日 11:10
  **/
-public interface StatisticReportService{
+public interface StatisticReportService {
+
+    Map<String, Object> datas(StatisticReport report);
+
+    List<StatisticReport> selectList(StatisticReport report);
+
+    AjaxResult saveOrUpdate(StatisticReport report);
+
     /**
      * 获取表报详情
      * @param id
      * @return
      */
     AjaxResult getReportInfo (Long id);
+   
 }
+

+ 30 - 1
boman-report/src/main/java/com/boman/report/service/impl/StatisticReportPersonnelImpl.java

@@ -1,8 +1,16 @@
 package com.boman.report.service.impl;
 
+import com.boman.domain.entity.StatisticReportPersonnel;
+import com.boman.report.mapper.StatisticReportPersonnelMapper;
+import com.boman.report.service.StatisticReportPersonnelService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
 
 import static com.boman.common.core.utils.obj.ObjectUtils.*;
 
@@ -11,7 +19,28 @@ import static com.boman.common.core.utils.obj.ObjectUtils.*;
  * @date 2021年08月24日 11:11
  **/
 @Service
-public class StatisticReportPersonnelImpl {
+public class StatisticReportPersonnelImpl implements StatisticReportPersonnelService {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(StatisticReportPersonnelImpl.class);
+
+    @Autowired
+    private StatisticReportPersonnelMapper personnelMapper;
+
+    @Override
+    @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
+    public int deleteByStatisticIds(List<Long> ids) {
+        return personnelMapper.deleteByStatisticIds(ids);
+    }
+
+    @Override
+    @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
+    public int insert(List<StatisticReportPersonnel> personnels) {
+        if(isEmpty(personnels)) {
+            return 0;
+        }
+        for(StatisticReportPersonnel personnel : personnels) {
+            personnelMapper.insert(personnel);
+        }
+        return personnels.size();
+    }
 }

+ 83 - 0
boman-report/src/main/java/com/boman/report/service/impl/StatisticReportServiceImpl.java

@@ -1,18 +1,25 @@
 package com.boman.report.service.impl;
 
+import com.boman.common.core.utils.CollectUtils;
 import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.dto.StatisticReportDto;
 import com.boman.domain.entity.StatisticReport;
 import com.boman.domain.entity.StatisticReportPersonnel;
 import com.boman.domain.entity.vo.StatisticReportVo;
 import com.boman.report.mapper.StatisticReportMapper;
 import com.boman.report.mapper.StatisticReportPersonnelMapper;
 import com.boman.report.service.StatisticReportService;
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.report.service.StatisticReportPersonnelService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+
 import java.util.stream.Collectors;
 
 /**
@@ -23,6 +30,16 @@ import java.util.stream.Collectors;
 public class StatisticReportServiceImpl implements StatisticReportService {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ImportServiceImpl.class);
+
+
+    public static final String INSERT =  "insert";
+
+    public static final String UPDATE =  "update";
+
+
+    @Autowired
+    private StatisticReportPersonnelService personnelService;
+
     @Autowired
     private StatisticReportMapper statisticReportMapper;
 
@@ -71,4 +88,70 @@ public class StatisticReportServiceImpl implements StatisticReportService {
         }
         return AjaxResult.success(reportInfo);
     }
+
+    @Override
+    public Map<String, Object> datas(StatisticReport report) {
+        Map<String, Object> result = new HashMap<>();
+        List<StatisticReportDto> reportDtos = statisticReportMapper.selectReportInfo(SecurityUtils.getUsername());
+        result.put("reports", reportDtos);
+        return result;
+    }
+
+    @Override
+    public List<StatisticReport> selectList(StatisticReport report) {
+        report.setCreateBy(SecurityUtils.getUsername());
+        return statisticReportMapper.selectList(report);
+    }
+
+    @Override
+    @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
+    public AjaxResult saveOrUpdate(StatisticReport report) {
+        try {
+            if(report.getId() != null) { // 修改
+                this.genReport(report, UPDATE);
+                // 先删除所有字表数据
+                personnelService.deleteByStatisticIds(CollectUtils.newArrayList(report.getId()));
+                // 保存报表数据
+                statisticReportMapper.update(report);
+            }else {//新增
+                genReport(report, INSERT);
+                statisticReportMapper.insert(report);
+            }
+            // 获取人员
+            this.genReportPersonal(report);
+            personnelService.insert(report.getPersonnels());
+        }catch (Exception e) {
+            LOGGER.info("新增错误,{}", e.getMessage());
+            return AjaxResult.error();
+        }
+        return AjaxResult.success();
+    }
+
+    private void genReport(StatisticReport report, String type) {
+        Date now = new Date();
+        if(type.equals(INSERT)) {
+            report.setCreateBy(SecurityUtils.getUsername());
+            report.setCreateTime(now);
+            report.setUpdateTime(now);
+        }else{
+            report.setUpdateBy(SecurityUtils.getUsername());
+            report.setUpdateTime(now);
+        }
+    }
+
+    private void genReportPersonal(StatisticReport report) {
+        Long statisticId = report.getId();
+        String reportName =  report.getReportName();
+        String userName = SecurityUtils.getUsername();
+        Date now = new Date();
+        List<StatisticReportPersonnel> personnels = report.getPersonnels();
+        for (StatisticReportPersonnel personnel : personnels) {
+            personnel.setStatisticId(statisticId);
+            personnel.setReportName(reportName);
+            personnel.setCreateBy(userName);
+            personnel.setCreateTime(now);
+            personnel.setUpdateBy(userName);
+            personnel.setUpdateTime(now);
+        }
+    }
 }

+ 95 - 1
boman-report/src/main/resources/mapper/StatisticReportMapper.xml

@@ -31,4 +31,98 @@
         <include refid="selectStatisticReportVo"/>
         where id = #{id} and is_del = "N"
     </select>
-</mapper> 
+    <resultMap type="com.boman.domain.dto.StatisticReportDto" id="ReportDtoResult">
+        <id property="id" column="id"/>
+        <result property="name" column="name"/>
+    </resultMap>
+
+    <sql id="selectReportVo">
+        select * from statistic_report
+    </sql>
+
+    <select id="selectList" parameterType="com.boman.domain.entity.StatisticReport" resultMap="StatisticReportResult">
+        <include refid="selectReportVo"/>
+        <where>
+            <if test="id != null and id != ''">
+                AND id = #{id}
+            </if>
+            <if test="createBy != null and createBy != ''">
+                AND create_by = #{createBy}
+            </if>
+            <if test="reportName != null and reportName != ''">
+                AND lower(report_name) like lower(concat('%', #{reportName}, '%'))
+            </if>
+            <if test="sTime != null and sTime != ''">
+                AND date_format(start_time, '%Y-%m-%d') &lt;= #{sTime}
+            </if>
+            <if test="eTime != null and eTime != ''">
+                AND date_format(end_time, '%Y-%m-%d') &gt;= #{eTime}
+            </if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
+        </where>
+        order by create_time DESC
+        limit
+    </select>
+
+    <insert id="insert" parameterType="com.boman.domain.entity.StatisticReport" useGeneratedKeys="true" keyProperty="id">
+        insert into statistic_report
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="reportName != null and reportName != ''">report_name,</if>
+            <if test="reportId != null">report_id,</if>
+            <if test="templateName != null">template_name,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="reportStatus != null">report_status,</if>
+            <if test="status != null">status,</if>
+            <if test="repUploadFile != null and repUploadFile != ''">rep_upload_file,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="reportName != null and reportName != ''">#{reportName},</if>
+            <if test="reportId != null">#{reportId},</if>
+            <if test="templateName != null">#{templateName},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="reportStatus != null">#{reportStatus},</if>
+            <if test="status != null">#{status},</if>
+            <if test="repUploadFile != null and repUploadFile != ''">#{repUploadFile},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="isDel != null">#{isDel},</if>
+        </trim>
+    </insert>
+
+    <update id="update" parameterType="com.boman.domain.entity.StatisticReport">
+        update statistic_report
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="reportName != null and reportName != ''">report_name = #{reportName},</if>
+            <if test="reportId != null">report_id = #{reportId},</if>
+            <if test="templateName != null">template_name = #{template_name},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime == null">end_time = #{endTime},</if>
+            <if test="reportStatus != null">report_status = #{reportStatus},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="repUploadFile != null">rep_upload_file = #{repUploadFile},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isDel != null">is_del = #{isDel},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <select id="selectReportInfo" resultMap="ReportDtoResult" parameterType="java.lang.String">
+        select id, name from  jimu_report where create_by = #{userName} order by create_by desc
+    </select>
+</mapper>

+ 40 - 1
boman-report/src/main/resources/mapper/StatisticReportPersonnelMapper.xml

@@ -20,6 +20,45 @@
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <delete id="deleteByStatisticIds" parameterType="java.util.List">
+        delete from statistic_report_personnel where statistic_id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="insert" parameterType="com.boman.domain.entity.StatisticReportPersonnel">
+        insert into statistic_report_personnel
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="reportName != null and reportName != ''">report_name,</if>
+            <if test="statisticId != null">statistic_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="isDel != null">is_del,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="reportName != null and reportName != ''">#{reportName},</if>
+            <if test="statisticId != null">#{statisticId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="isDel != null">#{isDel},</if>
+            <if test="status != null">#{status},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
     <sql id="selectStatisticReportPersonnelVo">
         select id, report_name, statistic_id, dept_id, dept_name, user_id, user_name, is_del, status, create_by, create_time, update_by, update_time
         from statistic_report_personnel
@@ -29,4 +68,4 @@
         <include refid="selectStatisticReportPersonnelVo"/>
         where statistic_id = #{id} and is_del = "N"
     </select>
-</mapper> 
+</mapper>