Commit 7ef82a56 authored by hongguangwu's avatar hongguangwu

MVP1.6.9-社保自动化日志

parent 0820230c
/*
* 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.social.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;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
@TableName("t_social_soldier_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化日志")
public class TSocialSoldierLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 社保ID
*/
@ExcelAttribute(name = "社保ID", maxLength = 32)
@Length(max = 32, message = "社保ID不能超过32个字符")
@ExcelProperty("社保ID")
@Schema(description = "社保ID")
private String socialId;
/**
* 推送的任务ID
*/
@ExcelAttribute(name = "推送的任务ID", maxLength = 32)
@Length(max = 32, message = "推送的任务ID不能超过32个字符")
@ExcelProperty("推送的任务ID")
@Schema(description = "推送的任务ID")
private String addId;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 20)
@NotBlank(message = "身份证号不能为空")
@Length(max = 20, message = "身份证号不能超过20个字符")
@ExcelProperty("身份证号")
@Schema(description = "身份证号")
private String empIdcard;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 派单项:社保;医保
*/
@ExcelAttribute(name = "派单项:社保;医保", maxLength = 2)
@Length(max = 2, message = "派单项:社保;医保不能超过2个字符")
@ExcelProperty("派单项:社保;医保")
@Schema(description = "派单项:社保;医保")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Length(max = 2, message = "社保户不能超过50个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHuName;
/**
* 类型:提交;审核
*/
@ExcelAttribute(name = "类型:提交;审核", maxLength = 2)
@Length(max = 2, message = "类型:提交;审核不能超过2个字符")
@ExcelProperty("类型:提交;审核")
@Schema(description = "类型:提交;审核")
private String type;
/**
* 结果
*/
@ExcelAttribute(name = "结果", maxLength = 50)
@Length(max = 50, message = "结果不能超过50个字符")
@ExcelProperty("结果")
@Schema(description = "结果")
private String remark;
}
/*
* 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.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.util.Date;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
public class TSocialSoldierLogExportVo extends RowIndex implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 20)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "日期", isDate = true, dateFormat = "yyyy-MM-dd HH:mm")
@Schema(description = "日期")
@ExcelProperty("日期")
private Date createTime;
@ExcelAttribute(name = "派单项", maxLength = 2)
@Length(max = 2, message = "派单项:社保;医保不能超过2个字符")
@ExcelProperty("派单项:社保;医保")
@Schema(description = "派单项:社保;医保")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Length(max = 2, message = "社保户不能超过50个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHuName;
@ExcelAttribute(name = "类型", maxLength = 2)
@Length(max = 2, message = "类型:提交;审核不能超过2个字符")
@ExcelProperty("类型:提交;审核")
@Schema(description = "类型:提交;审核")
private String type;
@Length(max = 50, message = "结果 不能超过50 个字符")
@ExcelAttribute(name = "结果", maxLength = 50)
@Schema(description = "结果")
@ExcelProperty("结果")
private String remark;
}
/*
* 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.social.vo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
public class TSocialSoldierLogSearchVo extends TSocialSoldierLog {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间起")
private LocalDateTime createTimeStart;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间止")
private LocalDateTime createTimeEnd;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
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;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialsoldierlog")
@Tag(name = "自动化日志管理")
public class TSocialSoldierLogController {
private final TSocialSoldierLogService tSocialSoldierLogService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialSoldierLog>> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog) {
return new R<>(tSocialSoldierLogService.getTSocialSoldierLogPage(page, tSocialSoldierLog));
}
/**
* 不分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TSocialSoldierLog>> getTSocialSoldierLogNoPage(@RequestBody TSocialSoldierLogSearchVo tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.noPageDiy(tSocialSoldierLog));
}
/**
* 通过id查询自动化日志
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsocialsoldierlog_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_get')")
public R<TSocialSoldierLog> getById(@PathVariable("id") String id) {
return R.ok(tSocialSoldierLogService.getById(id));
}
/**
* 新增自动化日志
*
* @param tSocialSoldierLog 自动化日志
* @return R
*/
@Operation(summary = "新增自动化日志", description = "新增自动化日志:hasPermission('social_tsocialsoldierlog_add')")
@SysLog("新增自动化日志")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_add')")
public R<Boolean> save(@RequestBody TSocialSoldierLog tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.save(tSocialSoldierLog));
}
/**
* 修改自动化日志
*
* @param tSocialSoldierLog 自动化日志
* @return R
*/
@Operation(summary = "修改自动化日志", description = "修改自动化日志:hasPermission('social_tsocialsoldierlog_edit')")
@SysLog("修改自动化日志")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_edit')")
public R<Boolean> updateById(@RequestBody TSocialSoldierLog tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.updateById(tSocialSoldierLog));
}
/**
* 通过id删除自动化日志
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化日志", description = "通过id删除自动化日志:hasPermission('social_tsocialsoldierlog_del')")
@SysLog("通过id删除自动化日志")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialSoldierLogService.removeById(id));
}
/**
* 自动化日志 批量导出
*
* @author hgw
* @date 2024-08-30 10:27:16
**/
@Operation(description = "导出自动化日志 hasPermission('social_tsocialsoldierlog_export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_export')")
public void export(HttpServletResponse response, @RequestBody TSocialSoldierLogSearchVo searchVo) {
tSocialSoldierLogService.listExport(response, searchVo);
}
}
/*
* 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.social.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.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Mapper
public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, @Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
}
/*
* 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.social.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.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
public interface TSocialSoldierLogService extends IService<TSocialSoldierLog> {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog);
void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo);
List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo);
}
/*
* 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.social.service.impl;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierLogMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
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 hgw
* @date 2024-08-30 10:27:16
*/
@Log4j2
@Service
public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogMapper, TSocialSoldierLog> implements TSocialSoldierLogService {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Override
public IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog) {
return baseMapper.getTSocialSoldierLogPage(page, tSocialSoldierLog);
}
/**
* 自动化日志批量导出
*
* @return
*/
@Override
public void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo) {
String fileName = "自动化日志批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSocialSoldierLog> list = new ArrayList<>();
long count = noPageCountDiy(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 = EasyExcelFactory.write(out, TSocialSoldierLogExportVo.class).build();
int index = 0;
WriteSheet writeSheet;
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 = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("自动化日志" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
writeSheet = EasyExcelFactory.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);
}
}
}
@Override
public List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSocialSoldierLog::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TSocialSoldierLogSearchVo searchVo) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSocialSoldierLog::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TSocialSoldierLogSearchVo entity) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimeStart())) {
wrapper.ge(TSocialSoldierLog::getCreateTime, entity.getCreateTimeStart());
}
if (ArrayUtil.isNotEmpty(entity.getCreateTimeEnd())) {
wrapper.le(TSocialSoldierLog::getCreateTime, entity.getCreateTimeEnd());
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TSocialSoldierLog::getCreateName, entity.getCreateName());
}
return wrapper;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!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.social.mapper.TSocialSoldierLogMapper">
<resultMap id="tSocialSoldierLogMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog">
<id property="id" column="ID"/>
<result property="addId" column="ADD_ID"/>
<result property="socialId" column="SOCIAL_ID"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empName" column="EMP_NAME"/>
<result property="dispatchItem" column="DISPATCH_ITEM"/>
<result property="socialHuName" column="SOCIAL_HU_NAME"/>
<result property="type" column="TYPE"/>
<result property="remark" column="REMARK"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.ADD_ID,
a.SOCIAL_ID,
a.EMP_IDCARD,
a.EMP_NAME,
a.DISPATCH_ITEM,
a.SOCIAL_HU_NAME,
a.TYPE,
a.REMARK,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME
</sql>
<sql id="tSocialSoldierLog_where">
<if test="tSocialSoldierLog != null">
<if test="tSocialSoldierLog.id != null and tSocialSoldierLog.id.trim() != ''">
AND a.ID = #{tSocialSoldierLog.id}
</if>
<if test="tSocialSoldierLog.addId != null and tSocialSoldierLog.addId.trim() != ''">
AND a.ADD_ID = #{tSocialSoldierLog.addId}
</if>
<if test="tSocialSoldierLog.socialId != null and tSocialSoldierLog.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tSocialSoldierLog.socialId}
</if>
<if test="tSocialSoldierLog.empIdcard != null and tSocialSoldierLog.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tSocialSoldierLog.empIdcard}
</if>
<if test="tSocialSoldierLog.empName != null and tSocialSoldierLog.empName.trim() != ''">
AND a.EMP_NAME = #{tSocialSoldierLog.empName}
</if>
<if test="tSocialSoldierLog.dispatchItem != null and tSocialSoldierLog.dispatchItem.trim() != ''">
AND a.DISPATCH_ITEM = #{tSocialSoldierLog.dispatchItem}
</if>
<if test="tSocialSoldierLog.socialHuName != null and tSocialSoldierLog.socialHuName.trim() != ''">
AND a.SOCIAL_HU_NAME = #{tSocialSoldierLog.socialHuName}
</if>
<if test="tSocialSoldierLog.type != null and tSocialSoldierLog.type.trim() != ''">
AND a.TYPE = #{tSocialSoldierLog.type}
</if>
<if test="tSocialSoldierLog.remark != null and tSocialSoldierLog.remark.trim() != ''">
AND a.REMARK = #{tSocialSoldierLog.remark}
</if>
<if test="tSocialSoldierLog.createBy != null and tSocialSoldierLog.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialSoldierLog.createBy}
</if>
<if test="tSocialSoldierLog.updateBy != null and tSocialSoldierLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialSoldierLog.updateBy}
</if>
<if test="tSocialSoldierLog.createName != null and tSocialSoldierLog.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialSoldierLog.createName}
</if>
<if test="tSocialSoldierLog.updateTime != null">
AND a.UPDATE_TIME = #{tSocialSoldierLog.updateTime}
</if>
<if test="tSocialSoldierLog.createTimeStart != null">
AND a.CREATE_TIME >= #{tSocialSoldierLog.createTimeStart}
</if>
<if test="tSocialSoldierLog.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tSocialSoldierLog.createTimeEnd}
</if>
</if>
</sql>
<!--tSocialSoldierLog简单分页查询-->
<select id="getTSocialSoldierLogPage" resultMap="tSocialSoldierLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_log a
<where>
1=1
<include refid="tSocialSoldierLog_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