Commit aa651dad authored by huyuchen's avatar huyuchen

huych-风险管控提交

parent 14017361
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
@Data
@TableName("t_risk_monitor")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "风险管控统计")
public class TRiskMonitor extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 结算主体名称
*/
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称不能为空", maxLength = 50)
@ExcelProperty("项目名称")
@Schema(description = "项目名称")
private String departName;
/**
* 结算主体编码
*/
@ExcelAttribute(name = "项目编码", isNotEmpty = true, errorInfo = "项目编码不能为空", maxLength = 32)
@NotBlank(message = "项目编码不能为空")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String departNo;
/**
* 项目状态:0正常 1停止服务 2 已冻结
*/
@ExcelAttribute(name = "项目状态", isNotEmpty = true, errorInfo = "项目状态不能为空", maxLength = 1)
@NotBlank(message = "项目状态:0正常 1停止服务 2 已冻结不能为空")
@Length(max = 1, message = "项目状态:0正常 1停止服务 2 已冻结不能超过1个字符")
@ExcelProperty("项目状态")
@Schema(description = "项目状态:0正常 1停止服务 2 已冻结")
private String stopFlag;
/**
* 二级指标归属
*/
@ExcelAttribute(name = "二级指标归属", maxLength = 50)
@Length(max = 50, message = "二级指标归属不能超过50个字符")
@ExcelProperty("二级指标归属")
@Schema(description = "二级指标归属")
private String secondIndicatorBelong;
/**
* 是否存在风险 0 是 1否
*/
@ExcelAttribute(name = "是否存在风险", maxLength = 1)
@Length(max = 1, message = "是否存在风险 0 是 1否不能超过1个字符")
@ExcelProperty("是否存在风险")
@Schema(description = "是否存在风险 0 是 1否")
private String isRisk;
/**
* 可能风险点
*/
@ExcelAttribute(name = "可能风险点")
@ExcelProperty("可能风险点")
@Schema(description = "可能风险点")
private String riskType;
/**
* 在项人数
*/
@ExcelAttribute(name = "在项人数")
@ExcelProperty("在项人数")
@Schema(description = "在项人数")
private Integer projectNum;
/**
* 不在项人员有效合同数
*/
@ExcelAttribute(name = "不在项人员有效合同数")
@ExcelProperty("不在项人员有效合同数")
@Schema(description = "不在项人员有效合同数")
private Integer unproContractNum;
/**
* 在项人员有效合同数
*/
@ExcelAttribute(name = "在项人员有效合同数")
@ExcelProperty("在项人员有效合同数")
@Schema(description = "在项人员有效合同数")
private Integer proContractNum;
/**
* 不在项人员有效商险数
*/
@ExcelAttribute(name = "不在项人员有效商险数")
@ExcelProperty("不在项人员有效商险数")
@Schema(description = "不在项人员有效商险数")
private Integer unproInsuranceNum;
/**
* 在项人员有效商险数
*/
@ExcelAttribute(name = "在项人员有效商险数")
@ExcelProperty("在项人员有效商险数")
@Schema(description = "在项人员有效商险数")
private Integer proInsuranceNum;
/**
* 不在项人员有效社保数
*/
@ExcelAttribute(name = "不在项人员有效社保数")
@ExcelProperty("不在项人员有效社保数")
@Schema(description = "不在项人员有效社保数")
private Integer unproSocialNum;
/**
* 在项人员有效社保数
*/
@ExcelAttribute(name = "在项人员有效社保数")
@ExcelProperty("在项人员有效社保数")
@Schema(description = "在项人员有效社保数")
private Integer proSocialNum;
/**
* 不在项人员有效公积金数
*/
@ExcelAttribute(name = "不在项人员有效公积金数")
@ExcelProperty("不在项人员有效公积金数")
@Schema(description = "不在项人员有效公积金数")
private Integer unproFundNum;
/**
* 在项人员有效公积金数
*/
@ExcelAttribute(name = "在项人员有效公积金数")
@ExcelProperty("在项人员有效公积金数")
@Schema(description = "在项人员有效公积金数")
private Integer proFundNum;
/**
* 不在项人员有效发薪数
*/
@ExcelAttribute(name = "不在项人员最后一次发薪人数")
@ExcelProperty("不在项人员最后一次发薪人数")
@Schema(description = "不在项人员最后一次发薪人数")
private Integer unproSalaryNum;
/**
* 在项人员有效发薪数
*/
@ExcelAttribute(name = "在项人员最后一次发薪人数")
@ExcelProperty("在项人员最后一次发薪人数")
@Schema(description = "在项人员最后一次发薪人数")
private Integer proSalaryNum;
/**
* 最后发薪日期
*/
@ExcelAttribute(name = "最后一次发薪日期", isDate = true)
@ExcelProperty("最后一次发薪日期")
@Schema(description = "最后一次发薪日期")
private Date lastSalaryTime;
/**
* 所属客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
@Schema(description = "客户名称")
private String customerName;
/**
* 所属客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 50)
@Length(max = 50, message = "客户编码不能超过50个字符")
@ExcelProperty("客户编码")
@Schema(description = "客户编码")
private String customerNo;
/**
* 业务类型分类
*/
@ExcelAttribute(name = "业务类型", maxLength = 32)
@Length(max = 32, message = "业务类型不能超过32个字符")
@ExcelProperty("业务类型")
@Schema(description = "业务类型")
private String businessPrimaryType;
/**
* 业务类型二级分类
*/
@ExcelAttribute(name = "二级分类", maxLength = 32)
@Length(max = 32, message = "二级分类不能超过32个字符")
@ExcelProperty("二级分类")
@Schema(description = "二级分类")
private String businessSecondType;
/**
* 业务类型三级分类
*/
@ExcelAttribute(name = "三级分类", maxLength = 32)
@Length(max = 32, message = "三级分类不能超过32个字符")
@ExcelProperty("三级分类")
@Schema(description = "三级分类")
private String businessThirdType;
/**
* 条线类型
*/
@ExcelAttribute(name = "条线类型", maxLength = 20)
@Length(max = 20, message = "条线类型不能超过20个字符")
@ExcelProperty("条线类型")
@Schema(description = "条线类型")
private String lineType;
/**
* BU归属
*/
@ExcelAttribute(name = "BU归属", maxLength = 20)
@Length(max = 20, message = "BU归属不能超过20个字符")
@ExcelProperty("BU归属")
@Schema(description = "BU归属")
private String buBelong;
/**
* 是否删除(0否/1是)
*/
@Schema(description = "是否删除(0否/1是)")
private String deleteFlag;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
@Data
public class TRiskMonitorSearchVo extends TRiskMonitor {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,id数组")
private List<String> idList;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.service.TRiskMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TRiskMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/triskmonitor")
@Tag(name = "风险管控统计管理")
public class TRiskMonitorController {
private final TRiskMonitorService tRiskMonitorService;
/**
* 通过id查询风险管控统计
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('archives_triskmonitor_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('archives_triskmonitor_get')")
public R<TRiskMonitor> getById(@PathVariable("id") String id) {
return R.ok(tRiskMonitorService.getById(id));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param tRiskMonitor 风险管控统计
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TRiskMonitor>> getTRiskMonitorPage(Page<TRiskMonitor> page, TRiskMonitorSearchVo tRiskMonitor) {
return new R<>(tRiskMonitorService.getTRiskMonitorPage(page, tRiskMonitor));
}
/**
* 新增风险管控统计
*
* @param tRiskMonitor 风险管控统计
* @return R
*/
@Operation(summary = "新增风险管控统计", description = "新增风险管控统计:hasPermission('archives_triskmonitor_add')")
@SysLog("新增风险管控统计")
@PostMapping
@PreAuthorize("@pms.hasPermission('archives_triskmonitor_add')")
public R<Boolean> save(@RequestBody TRiskMonitor tRiskMonitor) {
return R.ok(tRiskMonitorService.save(tRiskMonitor));
}
/**
* 通过id删除风险管控统计
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除风险管控统计", description = "通过id删除风险管控统计:hasPermission('archives_triskmonitor_del')")
@SysLog("通过id删除风险管控统计")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('archives_triskmonitor_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tRiskMonitorService.removeById(id));
}
/**
* 风险管控统计 批量导出
*
* @author huych
* @date 2024-09-25 10:01:06
**/
@Operation(description = "导出风险管控统计 hasPermission('archives_triskmonitor-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('archives_triskmonitor-export')")
public void export(HttpServletResponse response, @RequestBody TRiskMonitorSearchVo searchVo) {
tRiskMonitorService.listExport(response, searchVo);
}
}
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TRiskMonitorSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
@Mapper
public interface TRiskMonitorMapper extends BaseMapper<TRiskMonitor> {
/**
* 风险管控统计简单分页查询
* @param tRiskMonitor 风险管控统计
* @return
*/
IPage<TRiskMonitor> getTRiskMonitorPage(Page<TRiskMonitor> page, @Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor);
/**
* 风险管控统计简单分页查询
* @param tRiskMonitor 风险管控统计
* @return
*/
long getTRiskMonitorExportCount(@Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor);
/**
* 风险管控统计导出查询
* @param tRiskMonitor 风险管控统计
* @return
*/
List<TRiskMonitor> getRiskMonitorExportList(@Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TRiskMonitorSearchVo;
import javax.servlet.http.HttpServletResponse;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
public interface TRiskMonitorService extends IService<TRiskMonitor> {
/**
* 风险管控统计简单分页查询
* @param tRiskMonitor 风险管控统计
* @return
*/
IPage<TRiskMonitor> getTRiskMonitorPage(Page<TRiskMonitor> page, TRiskMonitorSearchVo tRiskMonitor);
/**
* 风险管控统计导出
* @param searchVo 风险管控统计
* @return
*/
void listExport(HttpServletResponse response, TRiskMonitorSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TRiskMonitorMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TRiskMonitorService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TRiskMonitorSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 风险管控统计
*
* @author huych
* @date 2024-09-25 10:01:06
*/
@Log4j2
@Service
public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRiskMonitor> implements TRiskMonitorService {
/**
* 风险管控统计简单分页查询
*
* @param tRiskMonitor 风险管控统计
* @return
*/
@Override
public IPage<TRiskMonitor> getTRiskMonitorPage(Page<TRiskMonitor> page, TRiskMonitorSearchVo tRiskMonitor) {
return baseMapper.getTRiskMonitorPage(page, tRiskMonitor);
}
/**
* 风险管控统计批量导出
*
* @param searchVo 风险管控统计
* @return
*/
@Override
public void listExport(HttpServletResponse response, TRiskMonitorSearchVo searchVo) {
String fileName = "风险管控统计批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TRiskMonitor> list = new ArrayList<>();
long count = baseMapper.getTRiskMonitorExportCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TRiskMonitor.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getRiskMonitorExportList(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TRiskMonitor> util = new ExcelUtil<>(TRiskMonitor.class);
for (TRiskMonitor vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("运营风险管控" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("运营风险管控" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.TRiskMonitorMapper">
<resultMap id="tRiskMonitorMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor">
<id property="id" column="ID"/>
<result property="departNo" column="DEPART_NO"/>
<result property="departName" column="DEPART_NAME"/>
<result property="stopFlag" column="STOP_FLAG"/>
<result property="businessPrimaryType" column="BUSINESS_PRIMARY_TYPE"/>
<result property="businessSecondType" column="BUSINESS_SECOND_TYPE"/>
<result property="businessThirdType" column="BUSINESS_THIRD_TYPE"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="customerNo" column="CUSTOMER_NO"/>
<result property="secondIndicatorBelong" column="SECOND_INDICATOR_BELONG"/>
<result property="lineType" column="LINE_TYPE"/>
<result property="buBelong" column="BU_BELONG"/>
<result property="isRisk" column="IS_RISK"/>
<result property="riskType" column="RISK_TYPE"/>
<result property="projectNum" column="PROJECT_NUM"/>
<result property="unproContractNum" column="UNPRO_CONTRACT_NUM"/>
<result property="proContractNum" column="PRO_CONTRACT_NUM"/>
<result property="unproInsuranceNum" column="UNPRO_INSURANCE_NUM"/>
<result property="proInsuranceNum" column="PRO_INSURANCE_NUM"/>
<result property="unproSocialNum" column="UNPRO_SOCIAL_NUM"/>
<result property="proSocialNum" column="PRO_SOCIAL_NUM"/>
<result property="unproFundNum" column="UNPRO_FUND_NUM"/>
<result property="proFundNum" column="PRO_FUND_NUM"/>
<result property="unproSalaryNum" column="UNPRO_SALARY_NUM"/>
<result property="proSalaryNum" column="PRO_SALARY_NUM"/>
<result property="lastSalaryTime" column="LAST_SALARY_TIME"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DEPART_NO,
a.DEPART_NAME,
a.STOP_FLAG,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.CUSTOMER_NAME,
a.CUSTOMER_NO,
a.SECOND_INDICATOR_BELONG,
a.LINE_TYPE,
a.BU_BELONG,
a.IS_RISK,
a.RISK_TYPE,
a.PROJECT_NUM,
a.UNPRO_CONTRACT_NUM,
a.PRO_CONTRACT_NUM,
a.UNPRO_INSURANCE_NUM,
a.PRO_INSURANCE_NUM,
a.UNPRO_SOCIAL_NUM,
a.PRO_SOCIAL_NUM,
a.UNPRO_FUND_NUM,
a.PRO_FUND_NUM,
a.UNPRO_SALARY_NUM,
a.PRO_SALARY_NUM,
a.LAST_SALARY_TIME,
a.DELETE_FLAG,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tRiskMonitor_where">
<if test="tRiskMonitor != null">
<if test="idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tRiskMonitor.id != null and tRiskMonitor.id.trim() != ''">
AND a.ID = #{tRiskMonitor.id}
</if>
<if test="tRiskMonitor.departNo != null and tRiskMonitor.departNo.trim() != ''">
AND a.DEPART_NO = #{tRiskMonitor.departNo}
</if>
<if test="tRiskMonitor.departName != null and tRiskMonitor.departName.trim() != ''">
AND a.DEPART_NAME like concat('%',#{tRiskMonitor.departName},'%')
</if>
<if test="tRiskMonitor.stopFlag != null and tRiskMonitor.stopFlag.trim() != ''">
AND a.STOP_FLAG = #{tRiskMonitor.stopFlag}
</if>
<if test="tRiskMonitor.businessPrimaryType != null and tRiskMonitor.businessPrimaryType.trim() != ''">
AND a.BUSINESS_PRIMARY_TYPE = #{tRiskMonitor.businessPrimaryType}
</if>
<if test="tRiskMonitor.businessSecondType != null and tRiskMonitor.businessSecondType.trim() != ''">
AND a.BUSINESS_SECOND_TYPE = #{tRiskMonitor.businessSecondType}
</if>
<if test="tRiskMonitor.businessThirdType != null and tRiskMonitor.businessThirdType.trim() != ''">
AND a.BUSINESS_THIRD_TYPE = #{tRiskMonitor.businessThirdType}
</if>
<if test="tRiskMonitor.customerName != null and tRiskMonitor.customerName.trim() != ''">
AND a.CUSTOMER_NAME = #{tRiskMonitor.customerName}
</if>
<if test="tRiskMonitor.customerNo != null and tRiskMonitor.customerNo.trim() != ''">
AND a.CUSTOMER_NO = #{tRiskMonitor.customerNo}
</if>
<if test="tRiskMonitor.secondIndicatorBelong != null and tRiskMonitor.secondIndicatorBelong.trim() != ''">
AND a.SECOND_INDICATOR_BELONG like concat('%',#{tRiskMonitor.secondIndicatorBelong},'%')
</if>
<if test="tRiskMonitor.lineType != null and tRiskMonitor.lineType.trim() != ''">
AND a.LINE_TYPE = #{tRiskMonitor.lineType}
</if>
<if test="tRiskMonitor.buBelong != null and tRiskMonitor.buBelong.trim() != ''">
AND a.BU_BELONG = #{tRiskMonitor.buBelong}
</if>
<if test="tRiskMonitor.isRisk != null and tRiskMonitor.isRisk.trim() != ''">
AND a.IS_RISK = #{tRiskMonitor.isRisk}
</if>
<if test="tRiskMonitor.riskType != null and tRiskMonitor.riskType.trim() != ''">
AND a.RISK_TYPE regexp #{tRiskMonitor.riskType}
</if>
</if>
</sql>
<!--tRiskMonitor简单分页查询-->
<select id="getTRiskMonitorPage" resultMap="tRiskMonitorMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_risk_monitor a
<where>
a.DELETE_FLAG = '0'
<include refid="tRiskMonitor_where"/>
</where>
</select>
<select id="getTRiskMonitorExportCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_risk_monitor a
<where>
a.DELETE_FLAG = '0'
<include refid="tRiskMonitor_where"/>
</where>
</select>
<!--tRiskMonitor导出查询-->
<select id="getRiskMonitorExportList" resultMap="tRiskMonitorMap">
SELECT
a.DEPART_NAME,
a.DEPART_NO,
CASE WHEN a.STOP_FLAG=0 THEN "正常"
WHEN a.STOP_FLAG =1 THEN "停止合作"
WHEN a.STOP_FLAG =2 THEN "已冻结"
ELSE a.STOP_FLAG END as STOP_FLAG,
a.SECOND_INDICATOR_BELONG,
CASE WHEN a.IS_RISK=0 THEN "是"
WHEN a.IS_RISK =1 THEN "否"
ELSE a.IS_RISK END as IS_RISK,
a.RISK_TYPE,
a.PROJECT_NUM,
a.UNPRO_CONTRACT_NUM,
a.PRO_CONTRACT_NUM,
a.UNPRO_INSURANCE_NUM,
a.PRO_INSURANCE_NUM,
a.UNPRO_SOCIAL_NUM,
a.PRO_SOCIAL_NUM,
a.UNPRO_FUND_NUM,
a.PRO_FUND_NUM,
a.UNPRO_SALARY_NUM,
a.PRO_SALARY_NUM,
a.LAST_SALARY_TIME,
a.CUSTOMER_NAME,
a.CUSTOMER_NO,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.LINE_TYPE,
a.BU_BELONG
FROM t_risk_monitor a
<where>
a.DELETE_FLAG = '0'
<include refid="tRiskMonitor_where"/>
</where>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment