bobol
6 months ago
18 changed files with 860 additions and 132 deletions
@ -0,0 +1,143 @@ |
|||||
|
package com.lzbi.report.controller; |
||||
|
import com.lzbi.bi.domain.ExportWeatherReq; |
||||
|
import com.lzbi.code.domain.WeatherReportVO; |
||||
|
import io.swagger.annotations.ApiImplicitParam; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.List; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.PutMapping; |
||||
|
import org.springframework.web.bind.annotation.DeleteMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
import com.lzbi.common.annotation.Log; |
||||
|
import com.lzbi.common.core.controller.BaseController; |
||||
|
import com.lzbi.common.core.domain.AjaxResult; |
||||
|
import com.lzbi.common.enums.BusinessType; |
||||
|
import com.lzbi.report.domain. DcBusiReportRecord; |
||||
|
import com.lzbi.report.service.DcBusiReportRecordService; |
||||
|
import com.lzbi.common.utils.poi.ExcelUtil; |
||||
|
import com.lzbi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 报表记录Controller |
||||
|
* |
||||
|
* @author enbo.li |
||||
|
* @date 2024-05-21 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/report/reportRecord") |
||||
|
public class DcBusiReportRecordController extends BaseController |
||||
|
{ |
||||
|
@Autowired |
||||
|
private DcBusiReportRecordService dcBusiReportRecordService; |
||||
|
|
||||
|
/** |
||||
|
* 查询报表记录列表 |
||||
|
*/ |
||||
|
@ApiOperation("查询报表记录列表") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "DcBusiReportRecord", value = "", dataType = "DcBusiReportRecord", dataTypeClass = DcBusiReportRecord.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:list')") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo list(DcBusiReportRecord DcBusiReportRecord) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List< DcBusiReportRecord> list = dcBusiReportRecordService.selectDcBusiReportRecordList(DcBusiReportRecord); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出报表记录列表 |
||||
|
*/ |
||||
|
@ApiOperation("导出报表记录列表") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "DcBusiReportRecord", value = "", dataType = "DcBusiReportRecord", dataTypeClass = DcBusiReportRecord.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:export')") |
||||
|
@Log(title = "报表记录", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(HttpServletResponse response,DcBusiReportRecord DcBusiReportRecord) |
||||
|
{ |
||||
|
List<DcBusiReportRecord> list = dcBusiReportRecordService.selectDcBusiReportRecordList(DcBusiReportRecord); |
||||
|
ExcelUtil<DcBusiReportRecord> util = new ExcelUtil<DcBusiReportRecord>(DcBusiReportRecord.class); |
||||
|
util.exportExcel(response, list, "报表记录数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取报表记录详细信息 |
||||
|
*/ |
||||
|
@ApiOperation("获取报表记录详细信息") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:query')") |
||||
|
@GetMapping(value = "/{id}") |
||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) |
||||
|
{ |
||||
|
return success(dcBusiReportRecordService.selectDcBusiReportRecordById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增报表记录 |
||||
|
*/ |
||||
|
@ApiOperation("新增报表记录") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "DcBusiReportRecord", value = "", dataType = "DcBusiReportRecord", dataTypeClass = DcBusiReportRecord.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:add')") |
||||
|
@Log(title = "报表记录", businessType = BusinessType.INSERT) |
||||
|
@PostMapping |
||||
|
public AjaxResult add(@RequestBody DcBusiReportRecord DcBusiReportRecord) |
||||
|
{ |
||||
|
return toAjax(dcBusiReportRecordService.insertDcBusiReportRecord(DcBusiReportRecord)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改报表记录 |
||||
|
*/ |
||||
|
|
||||
|
@ApiOperation("修改报表记录") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "DcBusiReportRecord", value = "", dataType = "DcBusiReportRecord", dataTypeClass = DcBusiReportRecord.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:edit')") |
||||
|
@Log(title = "报表记录", businessType = BusinessType.UPDATE) |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody DcBusiReportRecord DcBusiReportRecord) |
||||
|
{ |
||||
|
return toAjax(dcBusiReportRecordService.updateDcBusiReportRecord(DcBusiReportRecord)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除报表记录 |
||||
|
*/ |
||||
|
@ApiOperation("删除报表记录") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), |
||||
|
}) |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:remove')") |
||||
|
@Log(title = "报表记录", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public AjaxResult remove(@PathVariable Long[] ids) |
||||
|
{ |
||||
|
return toAjax(dcBusiReportRecordService.deleteDcBusiReportRecordByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("天气报表") |
||||
|
@PreAuthorize("@ss.hasPermi('report:reportRecord:download')") |
||||
|
@PostMapping("/download/{id}") |
||||
|
public void downloadFile(HttpServletResponse response, @PathVariable("id") Long id) throws IOException { |
||||
|
dcBusiReportRecordService.downloadFile(response, id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package com.lzbi.report.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.lzbi.common.annotation.Excel; |
||||
|
import com.lzbi.module.base.BaseModuleEntity; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.experimental.Accessors; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 报表记录对象 dc_busi_report_record |
||||
|
* |
||||
|
* @author enbo.li |
||||
|
* @date 2024-05-21 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Accessors(chain = true) |
||||
|
public class DcBusiReportRecord extends BaseModuleEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 主键 */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 报表名称 */ |
||||
|
@Excel(name = "报表名称") |
||||
|
@ApiModelProperty(name = "报表名称",notes = "reportName") |
||||
|
private String reportName; |
||||
|
|
||||
|
/** 文件路径 */ |
||||
|
@Excel(name = "文件路径") |
||||
|
@ApiModelProperty(name = "文件路径",notes = "url") |
||||
|
private String url; |
||||
|
|
||||
|
/** 状态 0准备数据 1未下载 2已下载 */ |
||||
|
@Excel(name = "状态 0准备数据 1未下载 2已下载") |
||||
|
@ApiModelProperty(name = "状态 0准备数据 1未下载 2已下载",notes = "status") |
||||
|
private String status; |
||||
|
|
||||
|
/** 部门ID */ |
||||
|
@Excel(name = "部门ID") |
||||
|
@ApiModelProperty(name = "部门ID",notes = "deptId") |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Excel(name = "备注") |
||||
|
@ApiModelProperty(name = "备注",notes = "remark") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 部门名称 */ |
||||
|
@TableField(exist = false) |
||||
|
private String deptName; |
||||
|
|
||||
|
/** 用户姓名 */ |
||||
|
@TableField(exist = false) |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
@ApiModelProperty(name = "创建时间", notes = "") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,63 @@ |
|||||
|
package com.lzbi.report.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.lzbi.report.domain.DcBusiReportRecord; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 报表记录Mapper接口 |
||||
|
* |
||||
|
* @author enbo.li |
||||
|
* @date 2024-05-21 |
||||
|
*/ |
||||
|
|
||||
|
public interface DcBusiReportRecordMapper extends BaseMapper<DcBusiReportRecord> |
||||
|
{ |
||||
|
/** |
||||
|
* 查询报表记录 |
||||
|
* |
||||
|
* @param id 报表记录主键 |
||||
|
* @return 报表记录 |
||||
|
*/ |
||||
|
public DcBusiReportRecord selectDcBusiReportRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询报表记录列表 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 报表记录集合 |
||||
|
*/ |
||||
|
public List<DcBusiReportRecord> selectDcBusiReportRecordList(DcBusiReportRecord dcBusiReportRecord); |
||||
|
|
||||
|
/** |
||||
|
* 新增报表记录 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertDcBusiReportRecord(DcBusiReportRecord dcBusiReportRecord); |
||||
|
|
||||
|
/** |
||||
|
* 修改报表记录 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateDcBusiReportRecord(DcBusiReportRecord dcBusiReportRecord); |
||||
|
|
||||
|
/** |
||||
|
* 删除报表记录 |
||||
|
* |
||||
|
* @param id 报表记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBusiReportRecordById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除报表记录 |
||||
|
* |
||||
|
* @param ids 需要删除的数据主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteDcBusiReportRecordByIds(Long[] ids); |
||||
|
} |
@ -0,0 +1,146 @@ |
|||||
|
package com.lzbi.report.service; |
||||
|
|
||||
|
import java.io.*; |
||||
|
import java.nio.file.Files; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import cn.hutool.core.util.IdUtil; |
||||
|
import com.lzbi.common.constant.BizConstants; |
||||
|
import org.apache.commons.compress.utils.IOUtils; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.lzbi.report.domain.DcBusiReportRecord; |
||||
|
import com.lzbi.report.mapper.DcBusiReportRecordMapper; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* 报表记录Service业务层处理 |
||||
|
* |
||||
|
* @author enbo.li |
||||
|
* @date 2024-05-21 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DcBusiReportRecordService extends ServiceImpl<DcBusiReportRecordMapper, DcBusiReportRecord> implements IService<DcBusiReportRecord> |
||||
|
{ |
||||
|
|
||||
|
// 雪花算法
|
||||
|
private static final Snowflake snowflake = IdUtil.getSnowflake(1, 3); |
||||
|
|
||||
|
@Value("${reportFilePath}") |
||||
|
private String reportFilePath; |
||||
|
|
||||
|
/** |
||||
|
* 查询报表记录 |
||||
|
* |
||||
|
* @param id 报表记录主键 |
||||
|
* @return 报表记录 |
||||
|
*/ |
||||
|
public DcBusiReportRecord selectDcBusiReportRecordById(Long id) |
||||
|
{ |
||||
|
return baseMapper.selectDcBusiReportRecordById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询报表记录列表 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 报表记录 |
||||
|
*/ |
||||
|
public List<DcBusiReportRecord> selectDcBusiReportRecordList(DcBusiReportRecord dcBusiReportRecord) |
||||
|
{ |
||||
|
return baseMapper.selectDcBusiReportRecordList(dcBusiReportRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增报表记录 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
|
||||
|
public int insertDcBusiReportRecord(DcBusiReportRecord dcBusiReportRecord) |
||||
|
{ |
||||
|
String url = reportFilePath + "/" + snowflake.nextId(); |
||||
|
dcBusiReportRecord.setUrl(url); |
||||
|
return baseMapper.insert(dcBusiReportRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改报表记录 |
||||
|
* |
||||
|
* @param dcBusiReportRecord 报表记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
|
||||
|
public int updateDcBusiReportRecord(DcBusiReportRecord dcBusiReportRecord) |
||||
|
{ |
||||
|
return baseMapper.updateDcBusiReportRecord(dcBusiReportRecord); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量删除报表记录 |
||||
|
* |
||||
|
* @param ids 需要删除的报表记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int deleteDcBusiReportRecordByIds(Long[] ids) |
||||
|
{ |
||||
|
List<DcBusiReportRecord> dcBusiReportRecords = baseMapper.selectBatchIds(Arrays.asList(ids)); |
||||
|
if (!CollectionUtils.isEmpty(dcBusiReportRecords)) { |
||||
|
dcBusiReportRecords.forEach(reportRecord -> { |
||||
|
String url = reportRecord.getUrl(); |
||||
|
File file = new File(url); |
||||
|
if (file.exists()) { |
||||
|
file.delete(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
return baseMapper.deleteDcBusiReportRecordByIds(ids); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除报表记录信息 |
||||
|
* |
||||
|
* @param id 报表记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public int deleteDcBusiReportRecordById(Long id) |
||||
|
{ |
||||
|
DcBusiReportRecord reportRecord = selectDcBusiReportRecordById(id); |
||||
|
String url = reportRecord.getUrl(); |
||||
|
File file = new File(url); |
||||
|
if (file.exists()) { |
||||
|
file.delete(); |
||||
|
} |
||||
|
return baseMapper.deleteDcBusiReportRecordById(id); |
||||
|
} |
||||
|
|
||||
|
public void downloadFile(HttpServletResponse response, Long id) { |
||||
|
DcBusiReportRecord reportRecord = selectDcBusiReportRecordById(id); |
||||
|
String url = reportRecord.getUrl(); |
||||
|
File file = new File(url); |
||||
|
if (!file.exists()) { |
||||
|
return; |
||||
|
} |
||||
|
response.setContentType("application/octet-stream"); |
||||
|
response.setCharacterEncoding("utf-8"); |
||||
|
response.setHeader("Content-Disposition", "attachment;fileName=" + file.getName()); |
||||
|
try (InputStream inputStream = Files.newInputStream(file.toPath())) { |
||||
|
IOUtils.copy(inputStream, response.getOutputStream()); |
||||
|
} catch (IOException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
// 更新状态
|
||||
|
reportRecord.setStatus(BizConstants.ReportRecordStatus.DOWNLOADED); |
||||
|
updateDcBusiReportRecord(reportRecord); |
||||
|
} |
||||
|
} |
@ -0,0 +1,118 @@ |
|||||
|
<?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.lzbi.report.mapper.DcBusiReportRecordMapper"> |
||||
|
|
||||
|
<resultMap type="com.lzbi.report.domain.DcBusiReportRecord" id="DcBusiReportRecordResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="reportName" column="report_name" /> |
||||
|
<result property="url" column="url" /> |
||||
|
<result property="status" column="status" /> |
||||
|
<result property="deptId" column="dept_id" /> |
||||
|
<result property="createdBy" column="created_by" /> |
||||
|
<result property="createdTime" column="created_time" /> |
||||
|
<result property="updatedBy" column="updated_by" /> |
||||
|
<result property="updatedTime" column="updated_time" /> |
||||
|
<result property="remark" column="remark" /> |
||||
|
<result property="deptName" column="dept_name" /> |
||||
|
<result property="nickName" column="nick_name" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectDcBusiReportRecordVo"> |
||||
|
select id, report_name, url, status, dept_id, created_by, created_time, updated_by, updated_time, remark from dc_busi_report_record |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectDcBusiReportRecordList" parameterType="DcBusiReportRecord" resultMap="DcBusiReportRecordResult"> |
||||
|
select |
||||
|
t1.id, |
||||
|
t1.report_name, |
||||
|
t1.url, |
||||
|
t1.status, |
||||
|
t1.dept_id, |
||||
|
t1.created_by, |
||||
|
t1.created_time, |
||||
|
t1.updated_by, |
||||
|
t1.updated_time, |
||||
|
t1.remark, |
||||
|
t2.dept_name, |
||||
|
t3.nick_name |
||||
|
from |
||||
|
dc_busi_report_record t1 |
||||
|
left join |
||||
|
sys_dept t2 |
||||
|
on |
||||
|
t1.dept_id = t2.dept_id |
||||
|
left join |
||||
|
sys_user t3 |
||||
|
on |
||||
|
t1.created_by = t3.user_name |
||||
|
<where> |
||||
|
<if test="status != null and status != ''"> and t1.status = #{status}</if> |
||||
|
<if test="reportName != null and reportName != ''"> and t1.report_name like concat(#{reportName}, '%')</if> |
||||
|
<if test="nickName != null and nickName != ''"> and t3.nick_name like concat(#{nickName}, '%')</if> |
||||
|
</where> |
||||
|
order by |
||||
|
t1.created_time desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectDcBusiReportRecordById" parameterType="Long" resultMap="DcBusiReportRecordResult"> |
||||
|
<include refid="selectDcBusiReportRecordVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertDcBusiReportRecord" parameterType="DcBusiReportRecord"> |
||||
|
insert into dc_busi_report_record |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null">id,</if> |
||||
|
<if test="reportName != null and reportName != ''">report_name,</if> |
||||
|
<if test="url != null and url != ''">url,</if> |
||||
|
<if test="status != null">status,</if> |
||||
|
<if test="deptId != null">dept_id,</if> |
||||
|
<if test="createdBy != null">created_by,</if> |
||||
|
<if test="createdTime != null">created_time,</if> |
||||
|
<if test="updatedBy != null">updated_by,</if> |
||||
|
<if test="updatedTime != null">updated_time,</if> |
||||
|
<if test="remark != null">remark,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null">#{id},</if> |
||||
|
<if test="reportName != null and reportName != ''">#{reportName},</if> |
||||
|
<if test="url != null and url != ''">#{url},</if> |
||||
|
<if test="status != null">#{status},</if> |
||||
|
<if test="deptId != null">#{deptId},</if> |
||||
|
<if test="createdBy != null">#{createdBy},</if> |
||||
|
<if test="createdTime != null">#{createdTime},</if> |
||||
|
<if test="updatedBy != null">#{updatedBy},</if> |
||||
|
<if test="updatedTime != null">#{updatedTime},</if> |
||||
|
<if test="remark != null">#{remark},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateDcBusiReportRecord" parameterType="DcBusiReportRecord"> |
||||
|
update dc_busi_report_record |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="reportName != null and reportName != ''">report_name = #{reportName},</if> |
||||
|
<if test="url != null and url != ''">url = #{url},</if> |
||||
|
<if test="status != null">status = #{status},</if> |
||||
|
<if test="deptId != null">dept_id = #{deptId},</if> |
||||
|
<if test="createdBy != null">created_by = #{createdBy},</if> |
||||
|
<if test="createdTime != null">created_time = #{createdTime},</if> |
||||
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if> |
||||
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if> |
||||
|
<if test="remark != null">remark = #{remark},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteDcBusiReportRecordById" parameterType="Long"> |
||||
|
delete from dc_busi_report_record where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteDcBusiReportRecordByIds" parameterType="String"> |
||||
|
delete from dc_busi_report_record where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
</mapper> |
Loading…
Reference in new issue