边代设备管理

This commit is contained in:
syruan 2024-09-11 17:03:43 +08:00
parent 2d173fdb37
commit 7bea1e047c
12 changed files with 1124 additions and 0 deletions

View File

@ -0,0 +1,41 @@
package com.bonus.base.controller;
import com.bonus.base.domain.TbBdDeviceRecord;
import com.bonus.base.domain.TbDevice;
import com.bonus.base.service.TbBdDeviceRecordService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 边带记录设备表(tb_bd_device_record)表控制层
*
*/
@RestController
@RequestMapping("/tbBdDeviceRecord")
public class TbBdDeviceRecordController extends BaseController {
/**
* 服务对象
*/
@Autowired
private TbBdDeviceRecordService tbBdDeviceRecordService;
/**
* 通过主键查询单条数据
*/
@GetMapping("{/id}")
public AjaxResult selectOne(@PathVariable("id") Long id) {
return success(tbBdDeviceRecordService.selectByPrimaryKey(id));
}
@GetMapping("/list")
public AjaxResult queryByPage(TbBdDeviceRecord record) {
startPage();
List<TbBdDeviceRecord> list = tbBdDeviceRecordService.getAll(record);
return AjaxResult.success(getDataTable(list));
}
}

View File

@ -0,0 +1,80 @@
package com.bonus.base.controller;
import com.bonus.base.domain.TbBdRecord;
import com.bonus.base.service.TbBdRecordService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 边带申请记录表(tb_bd_record)表控制层
* @author syruan
*/
@RestController
@RequestMapping("/tb_bd_record")
public class TbBdRecordController extends BaseController {
/**
* 服务对象
*/
@Autowired
private TbBdRecordService tbBdRecordService;
/**
* 通过主键查询单条数据
*/
@GetMapping("{/id}")
public AjaxResult selectById(@PathVariable("id") Long id) {
return success(tbBdRecordService.selectByPrimaryKey(id));
}
@GetMapping("/list")
public AjaxResult queryByPage(TbBdRecord tbBdRecord) {
startPage();
List<TbBdRecord> list = tbBdRecordService.getAll(tbBdRecord);
return AjaxResult.success(getDataTable(list));
}
/**
* 新增数据
*
* @param tbBdRecord 实体
* @return 新增结果
*/
@PostMapping
public AjaxResult add(@RequestBody @NotNull(message = "参数不能为空") @Valid TbBdRecord tbBdRecord) {
return toAjax(tbBdRecordService.insertSelective(tbBdRecord));
}
/**
* 编辑数据
*
* @param tbBdRecord 实体
* @return 编辑结果
*/
@PutMapping
public AjaxResult edit(@RequestBody @NotNull(message = "参数不能为空") @Valid TbBdRecord tbBdRecord) {
return toAjax(tbBdRecordService.updateByPrimaryKeySelective(tbBdRecord));
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@DeleteMapping("/{id}")
public AjaxResult deleteById(@PathVariable("id") Long id) {
return toAjax(tbBdRecordService.deleteByPrimaryKey(id));
}
}

View File

@ -0,0 +1,75 @@
package com.bonus.base.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Data;
/**
* @PackagePath: com.bonus.base.domain
* @author : 阮世耀
* @CreateTime: 2024-09-11
* @Description: 边带记录设备表
* @version : 1.0
*/
@ApiModel(description="边带记录设备表")
@Data
public class TbBdDeviceRecord implements Serializable {
/**
* id
*/
@ApiModelProperty(value="id")
private Long id;
/**
* 记录id
*/
@ApiModelProperty(value="记录id")
private Long recordId;
/**
* 设备名称
*/
@ApiModelProperty(value="设备名称")
@Size(max = 255,message = "设备名称最大长度要小于 255")
private String devName;
/**
* 设备编码-唯一校验
*/
@ApiModelProperty(value="设备编码-唯一校验")
@Size(max = 64,message = "设备编码-唯一校验最大长度要小于 64")
private String devCode;
/**
* 所属单位
*/
@ApiModelProperty(value="所属单位")
@Size(max = 64,message = "所属单位最大长度要小于 64")
private String unitName;
/**
* 所属区域
*/
@ApiModelProperty(value="所属区域")
@Size(max = 64,message = "所属区域最大长度要小于 64")
private String areaName;
/**
* 设备负责人
*/
@ApiModelProperty(value="设备负责人")
@Size(max = 64,message = "设备负责人最大长度要小于 64")
private String devUser;
/**
* 负责人电话-sm4加密
*/
@ApiModelProperty(value="负责人电话-sm4加密")
@Size(max = 128,message = "负责人电话-sm4加密最大长度要小于 128")
private String devUserPhone;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,127 @@
package com.bonus.base.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Data;
/**
*@PackagePath: com.bonus.base.domain
*@author : 阮世耀
*@CreateTime: 2024-09-11 15:46
*@Description: 描述
*@version : 1.0
*/
/**
* 边带申请记录表
*/
@ApiModel(description="边带申请记录表")
@Data
public class TbBdRecord implements Serializable {
/**
* 主键
*/
@ApiModelProperty(value="主键")
@NotNull(message = "主键不能为null")
private Long id;
/**
* 项目部id
*/
@ApiModelProperty(value="项目部id")
private Long departId;
/**
* 项目部名称
*/
@ApiModelProperty(value="项目部名称")
@Size(max = 64,message = "项目部名称最大长度要小于 64")
private String departName;
/**
* 工程id
*/
@ApiModelProperty(value="工程id")
private Long proId;
/**
* 工程名称
*/
@ApiModelProperty(value="工程名称")
@Size(max = 255,message = "工程名称最大长度要小于 255")
private String proName;
/**
* 申请人
*/
@ApiModelProperty(value="申请人")
@Size(max = 64,message = "申请人最大长度要小于 64")
private String relUser;
/**
* 联系方式(SM4 加密)
*/
@ApiModelProperty(value="联系方式(SM4 加密)")
@Size(max = 128,message = "联系方式(SM4 加密)最大长度要小于 128")
private String relPhone;
/**
* 删除状态
*/
@ApiModelProperty(value="删除状态")
private Integer delFlag;
/**
* 审核状态 0 待审核 1 通过 2 驳回
*/
@ApiModelProperty(value="审核状态 0 待审核 1 通过 2 驳回")
private Integer auditStatus;
/**
* 备注(驳回原因-重复驳回进行覆盖)
*/
@ApiModelProperty(value="备注(驳回原因-重复驳回进行覆盖)")
@Size(max = 255,message = "备注(驳回原因-重复驳回进行覆盖)最大长度要小于 255")
private String remarks;
/**
* 创建时间-申请时间
*/
@ApiModelProperty(value="创建时间-申请时间")
private Date createTime;
/**
* 创建人
*/
@ApiModelProperty(value="创建人")
private Long createUser;
/**
* 修改时间
*/
@ApiModelProperty(value="修改时间")
private Date updateTime;
/**
* 修改人
*/
@ApiModelProperty(value="修改人")
private Long updateUser;
/**
* 审核人
*/
@ApiModelProperty(value="审核人")
private Long auditUser;
/**
* 审核时间
*/
@ApiModelProperty(value="审核时间")
private Date auditTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,34 @@
package com.bonus.base.mapper;
import com.bonus.base.domain.TbBdDeviceRecord;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @PackagePath: com.bonus.base.mapper
* @author : 阮世耀
* @version : 1.0
*/
@Mapper
public interface TbBdDeviceRecordMapper {
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKeyIn(List<Long> list);
int insert(TbBdDeviceRecord record);
int insertSelective(TbBdDeviceRecord record);
TbBdDeviceRecord selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TbBdDeviceRecord record);
int updateByPrimaryKey(TbBdDeviceRecord record);
int updateBatch(List<TbBdDeviceRecord> list);
List<TbBdDeviceRecord> getAll(TbBdDeviceRecord record);
}

View File

@ -0,0 +1,35 @@
package com.bonus.base.mapper;
import com.bonus.base.domain.TbBdRecord;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
*@PackagePath: com.bonus.base.mapper
*@author : 阮世耀
*@version : 1.0
*/
@Mapper
public interface TbBdRecordMapper {
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKeyIn(List<Long> list);
int insert(TbBdRecord record);
int insertSelective(TbBdRecord record);
TbBdRecord selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TbBdRecord record);
int updateByPrimaryKey(TbBdRecord record);
int updateBatch(List<TbBdRecord> list);
List<TbBdRecord> getAll(TbBdRecord record);
}

View File

@ -0,0 +1,32 @@
package com.bonus.base.service;
import java.util.List;
import com.bonus.base.domain.TbBdDeviceRecord;
/**
*@PackagePath: com.bonus.base.service
*@author : 阮世耀
*@CreateTime: 2024-09-11 15:36
*@Description: 描述
*@version : 1.0
*/
public interface TbBdDeviceRecordService{
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKeyIn(List<Long> list);
int insert(TbBdDeviceRecord record);
int insertSelective(TbBdDeviceRecord record);
TbBdDeviceRecord selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TbBdDeviceRecord record);
int updateByPrimaryKey(TbBdDeviceRecord record);
int updateBatch(List<TbBdDeviceRecord> list);
List<TbBdDeviceRecord> getAll(TbBdDeviceRecord record);
}

View File

@ -0,0 +1,32 @@
package com.bonus.base.service;
import com.bonus.base.domain.TbBdRecord;
import java.util.List;
/**
*@PackagePath: com.bonus.base.service
*@author : 阮世耀
*@CreateTime: 2024-09-11 15:46
*@Description: 描述
*@version : 1.0
*/
public interface TbBdRecordService{
int deleteByPrimaryKey(Long id);
int deleteByPrimaryKeyIn(List<Long> list);
int insert(TbBdRecord record);
int insertSelective(TbBdRecord record);
TbBdRecord selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TbBdRecord record);
int updateByPrimaryKey(TbBdRecord record);
int updateBatch(List<TbBdRecord> list);
List<TbBdRecord> getAll(TbBdRecord record);
}

View File

@ -0,0 +1,70 @@
package com.bonus.base.service.impl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.bonus.base.mapper.TbBdDeviceRecordMapper;
import com.bonus.base.domain.TbBdDeviceRecord;
import com.bonus.base.service.TbBdDeviceRecordService;
/**
* @PackagePath: com.bonus.base.service.impl
* @author : 阮世耀
* @version : 1.0
*/
@Service
public class TbBdDeviceRecordServiceImpl implements TbBdDeviceRecordService{
@Autowired
private TbBdDeviceRecordMapper tbBdDeviceRecordMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return tbBdDeviceRecordMapper.deleteByPrimaryKey(id);
}
@Override
public int deleteByPrimaryKeyIn(List<Long> list) {
return tbBdDeviceRecordMapper.deleteByPrimaryKeyIn(list);
}
@Override
public int insert(TbBdDeviceRecord record) {
return tbBdDeviceRecordMapper.insert(record);
}
@Override
public int insertSelective(TbBdDeviceRecord record) {
return tbBdDeviceRecordMapper.insertSelective(record);
}
@Override
public TbBdDeviceRecord selectByPrimaryKey(Long id) {
return tbBdDeviceRecordMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(TbBdDeviceRecord record) {
return tbBdDeviceRecordMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(TbBdDeviceRecord record) {
return tbBdDeviceRecordMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<TbBdDeviceRecord> list) {
return tbBdDeviceRecordMapper.updateBatch(list);
}
@Override
public List<TbBdDeviceRecord> getAll(TbBdDeviceRecord record){
return tbBdDeviceRecordMapper.getAll(record);
}
}

View File

@ -0,0 +1,71 @@
package com.bonus.base.service.impl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.bonus.base.domain.TbBdRecord;
import java.util.List;
import com.bonus.base.mapper.TbBdRecordMapper;
import com.bonus.base.service.TbBdRecordService;
/**
*@PackagePath: com.bonus.base.service.impl
*@author : 阮世耀
*@CreateTime: 2024-09-11 15:46
*@Description: 描述
*@version : 1.0
*/
@Service
public class TbBdRecordServiceImpl implements TbBdRecordService{
@Autowired
private TbBdRecordMapper tbBdRecordMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return tbBdRecordMapper.deleteByPrimaryKey(id);
}
@Override
public int deleteByPrimaryKeyIn(List<Long> list) {
return tbBdRecordMapper.deleteByPrimaryKeyIn(list);
}
@Override
public int insert(TbBdRecord record) {
return tbBdRecordMapper.insert(record);
}
@Override
public int insertSelective(TbBdRecord record) {
return tbBdRecordMapper.insertSelective(record);
}
@Override
public TbBdRecord selectByPrimaryKey(Long id) {
return tbBdRecordMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(TbBdRecord record) {
return tbBdRecordMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(TbBdRecord record) {
return tbBdRecordMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<TbBdRecord> list) {
return tbBdRecordMapper.updateBatch(list);
}
public List<TbBdRecord> getAll(TbBdRecord record){
return tbBdRecordMapper.getAll(record);
}
}

View File

@ -0,0 +1,196 @@
<?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.bonus.base.mapper.TbBdDeviceRecordMapper">
<resultMap id="BaseResultMap" type="com.bonus.base.domain.TbBdDeviceRecord">
<!--@mbg.generated-->
<!--@Table tb_bd_device_record-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="record_id" jdbcType="BIGINT" property="recordId" />
<result column="dev_name" jdbcType="VARCHAR" property="devName" />
<result column="dev_code" jdbcType="VARCHAR" property="devCode" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="area_name" jdbcType="VARCHAR" property="areaName" />
<result column="dev_user" jdbcType="VARCHAR" property="devUser" />
<result column="dev_user_phone" jdbcType="VARCHAR" property="devUserPhone" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, record_id, dev_name, dev_code, unit_name, area_name, dev_user, dev_user_phone
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from tb_bd_device_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from tb_bd_device_record
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.bonus.base.domain.TbBdDeviceRecord">
<!--@mbg.generated-->
insert into tb_bd_device_record (id, record_id, dev_name,
dev_code, unit_name, area_name,
dev_user, dev_user_phone)
values (#{id,jdbcType=BIGINT}, #{recordId,jdbcType=BIGINT}, #{devName,jdbcType=VARCHAR},
#{devCode,jdbcType=VARCHAR}, #{unitName,jdbcType=VARCHAR}, #{areaName,jdbcType=VARCHAR},
#{devUser,jdbcType=VARCHAR}, #{devUserPhone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.bonus.base.domain.TbBdDeviceRecord">
<!--@mbg.generated-->
insert into tb_bd_device_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="recordId != null">
record_id,
</if>
<if test="devName != null and devName != ''">
dev_name,
</if>
<if test="devCode != null and devCode != ''">
dev_code,
</if>
<if test="unitName != null and unitName != ''">
unit_name,
</if>
<if test="areaName != null and areaName != ''">
area_name,
</if>
<if test="devUser != null and devUser != ''">
dev_user,
</if>
<if test="devUserPhone != null and devUserPhone != ''">
dev_user_phone,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="recordId != null">
#{recordId,jdbcType=BIGINT},
</if>
<if test="devName != null and devName != ''">
#{devName,jdbcType=VARCHAR},
</if>
<if test="devCode != null and devCode != ''">
#{devCode,jdbcType=VARCHAR},
</if>
<if test="unitName != null and unitName != ''">
#{unitName,jdbcType=VARCHAR},
</if>
<if test="areaName != null and areaName != ''">
#{areaName,jdbcType=VARCHAR},
</if>
<if test="devUser != null and devUser != ''">
#{devUser,jdbcType=VARCHAR},
</if>
<if test="devUserPhone != null and devUserPhone != ''">
#{devUserPhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.base.domain.TbBdDeviceRecord">
<!--@mbg.generated-->
update tb_bd_device_record
<set>
<if test="recordId != null">
record_id = #{recordId,jdbcType=BIGINT},
</if>
<if test="devName != null and devName != ''">
dev_name = #{devName,jdbcType=VARCHAR},
</if>
<if test="devCode != null and devCode != ''">
dev_code = #{devCode,jdbcType=VARCHAR},
</if>
<if test="unitName != null and unitName != ''">
unit_name = #{unitName,jdbcType=VARCHAR},
</if>
<if test="areaName != null and areaName != ''">
area_name = #{areaName,jdbcType=VARCHAR},
</if>
<if test="devUser != null and devUser != ''">
dev_user = #{devUser,jdbcType=VARCHAR},
</if>
<if test="devUserPhone != null and devUserPhone != ''">
dev_user_phone = #{devUserPhone,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.bonus.base.domain.TbBdDeviceRecord">
<!--@mbg.generated-->
update tb_bd_device_record
set record_id = #{recordId,jdbcType=BIGINT},
dev_name = #{devName,jdbcType=VARCHAR},
dev_code = #{devCode,jdbcType=VARCHAR},
unit_name = #{unitName,jdbcType=VARCHAR},
area_name = #{areaName,jdbcType=VARCHAR},
dev_user = #{devUser,jdbcType=VARCHAR},
dev_user_phone = #{devUserPhone,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update tb_bd_device_record
<trim prefix="set" suffixOverrides=",">
<trim prefix="record_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.recordId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="dev_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.devName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="dev_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.devCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="unit_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.unitName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="area_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.areaName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="dev_user = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.devUser,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="dev_user_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.devUserPhone,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<delete id="deleteByPrimaryKeyIn">
<!--@mbg.generated-->
delete from tb_bd_device_record where id in
<foreach close=")" collection="list" item="id" open="(" separator=", ">
#{id,jdbcType=BIGINT}
</foreach>
</delete>
<!--by syruan on 2024-09-11-->
<select id="getAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tb_bd_device_record
</select>
</mapper>

View File

@ -0,0 +1,331 @@
<?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.bonus.base.mapper.TbBdRecordMapper">
<resultMap id="BaseResultMap" type="com.bonus.base.domain.TbBdRecord">
<!--@mbg.generated-->
<!--@Table tb_bd_record-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="depart_id" jdbcType="BIGINT" property="departId" />
<result column="depart_name" jdbcType="VARCHAR" property="departName" />
<result column="pro_id" jdbcType="BIGINT" property="proId" />
<result column="pro_name" jdbcType="VARCHAR" property="proName" />
<result column="rel_user" jdbcType="VARCHAR" property="relUser" />
<result column="rel_phone" jdbcType="VARCHAR" property="relPhone" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="audit_status" jdbcType="INTEGER" property="auditStatus" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_user" jdbcType="BIGINT" property="createUser" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="BIGINT" property="updateUser" />
<result column="audit_user" jdbcType="BIGINT" property="auditUser" />
<result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, depart_id, depart_name, pro_id, pro_name, rel_user, rel_phone, del_flag, audit_status,
remarks, create_time, create_user, update_time, update_user, audit_user, audit_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from tb_bd_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from tb_bd_record
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.bonus.base.domain.TbBdRecord">
<!--@mbg.generated-->
insert into tb_bd_record (id, depart_id, depart_name,
pro_id, pro_name, rel_user,
rel_phone, del_flag, audit_status,
remarks, create_time, create_user,
update_time, update_user, audit_user,
audit_time)
values (#{id,jdbcType=BIGINT}, #{departId,jdbcType=BIGINT}, #{departName,jdbcType=VARCHAR},
#{proId,jdbcType=BIGINT}, #{proName,jdbcType=VARCHAR}, #{relUser,jdbcType=VARCHAR},
#{relPhone,jdbcType=VARCHAR}, #{delFlag,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
#{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=BIGINT},
#{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=BIGINT}, #{auditUser,jdbcType=BIGINT},
#{auditTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.bonus.base.domain.TbBdRecord">
<!--@mbg.generated-->
insert into tb_bd_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="departId != null">
depart_id,
</if>
<if test="departName != null and departName != ''">
depart_name,
</if>
<if test="proId != null">
pro_id,
</if>
<if test="proName != null and proName != ''">
pro_name,
</if>
<if test="relUser != null and relUser != ''">
rel_user,
</if>
<if test="relPhone != null and relPhone != ''">
rel_phone,
</if>
<if test="delFlag != null">
del_flag,
</if>
<if test="auditStatus != null">
audit_status,
</if>
<if test="remarks != null and remarks != ''">
remarks,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateUser != null">
update_user,
</if>
<if test="auditUser != null">
audit_user,
</if>
<if test="auditTime != null">
audit_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="departId != null">
#{departId,jdbcType=BIGINT},
</if>
<if test="departName != null and departName != ''">
#{departName,jdbcType=VARCHAR},
</if>
<if test="proId != null">
#{proId,jdbcType=BIGINT},
</if>
<if test="proName != null and proName != ''">
#{proName,jdbcType=VARCHAR},
</if>
<if test="relUser != null and relUser != ''">
#{relUser,jdbcType=VARCHAR},
</if>
<if test="relPhone != null and relPhone != ''">
#{relPhone,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=INTEGER},
</if>
<if test="auditStatus != null">
#{auditStatus,jdbcType=INTEGER},
</if>
<if test="remarks != null and remarks != ''">
#{remarks,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null">
#{createUser,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateUser != null">
#{updateUser,jdbcType=BIGINT},
</if>
<if test="auditUser != null">
#{auditUser,jdbcType=BIGINT},
</if>
<if test="auditTime != null">
#{auditTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.base.domain.TbBdRecord">
<!--@mbg.generated-->
update tb_bd_record
<set>
<if test="departId != null">
depart_id = #{departId,jdbcType=BIGINT},
</if>
<if test="departName != null and departName != ''">
depart_name = #{departName,jdbcType=VARCHAR},
</if>
<if test="proId != null">
pro_id = #{proId,jdbcType=BIGINT},
</if>
<if test="proName != null and proName != ''">
pro_name = #{proName,jdbcType=VARCHAR},
</if>
<if test="relUser != null and relUser != ''">
rel_user = #{relUser,jdbcType=VARCHAR},
</if>
<if test="relPhone != null and relPhone != ''">
rel_phone = #{relPhone,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=INTEGER},
</if>
<if test="auditStatus != null">
audit_status = #{auditStatus,jdbcType=INTEGER},
</if>
<if test="remarks != null and remarks != ''">
remarks = #{remarks,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateUser != null">
update_user = #{updateUser,jdbcType=BIGINT},
</if>
<if test="auditUser != null">
audit_user = #{auditUser,jdbcType=BIGINT},
</if>
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.bonus.base.domain.TbBdRecord">
<!--@mbg.generated-->
update tb_bd_record
set depart_id = #{departId,jdbcType=BIGINT},
depart_name = #{departName,jdbcType=VARCHAR},
pro_id = #{proId,jdbcType=BIGINT},
pro_name = #{proName,jdbcType=VARCHAR},
rel_user = #{relUser,jdbcType=VARCHAR},
rel_phone = #{relPhone,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=INTEGER},
audit_status = #{auditStatus,jdbcType=INTEGER},
remarks = #{remarks,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_user = #{createUser,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_user = #{updateUser,jdbcType=BIGINT},
audit_user = #{auditUser,jdbcType=BIGINT},
audit_time = #{auditTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update tb_bd_record
<trim prefix="set" suffixOverrides=",">
<trim prefix="depart_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.departId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="depart_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.departName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pro_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.proId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="pro_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.proName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="rel_user = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.relUser,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="rel_phone = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.relPhone,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.delFlag,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="audit_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.auditStatus,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remarks = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.remarks,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_user = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createUser,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_user = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updateUser,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="audit_user = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.auditUser,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="audit_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.auditTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<delete id="deleteByPrimaryKeyIn">
<!--@mbg.generated-->
delete from tb_bd_record where id in
<foreach close=")" collection="list" item="id" open="(" separator=", ">
#{id,jdbcType=BIGINT}
</foreach>
</delete>
<!--by syruan on 2024-09-11-->
<select id="getAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tb_bd_record
</select>
</mapper>