兑换代币--智能合约执行
parent
aef055f125
commit
46bbbbc69d
@ -0,0 +1,176 @@
|
||||
package com.sztzjy.block_finance.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.sztzjy.block_finance.annotation.AnonymousAccess;
|
||||
import com.sztzjy.block_finance.config.Constant;
|
||||
import com.sztzjy.block_finance.config.exception.handler.InvoceTException;
|
||||
import com.sztzjy.block_finance.config.exception.handler.ServiceException;
|
||||
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
|
||||
import com.sztzjy.block_finance.service.StuDebtTransferStartService;
|
||||
import com.sztzjy.block_finance.util.ResultEntity;
|
||||
import com.sztzjy.block_finance.util.file.IFileUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/4/2 10:30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/stu/supplyChainFinance/operation")
|
||||
@Api(tags = "文件操作统一接口:下载、上传、读取、预览")
|
||||
public class StuOperationController {
|
||||
@Resource
|
||||
StuTransactionDocumentsInfoMapper stuTransactionDocumentsInfoMapper;
|
||||
@Resource
|
||||
StuDebtTransferStartService stuDebtTransferStartService;
|
||||
@Resource
|
||||
IFileUtil iFileUtil;
|
||||
@PostMapping("/download")
|
||||
@AnonymousAccess
|
||||
@ApiOperation("操作:下载")
|
||||
public void download(@ApiParam("文件名称") String docName,
|
||||
@ApiParam("用户ID") String userId,
|
||||
@RequestParam(required = false)@ApiParam("企业类别") String category,
|
||||
HttpServletResponse response){
|
||||
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("连带责任保证担保合同","/supply/部分18 连带责任保证担保合同.pdf");
|
||||
map.put("应收账款反转让承诺书","/supply/部分14 应收账款反转让承诺书.pdf");
|
||||
map.put("应收账款转让明细表","/supply/部分1 应收账款转让明细表.pdf");
|
||||
map.put("应收账款转让通知书","/supply/部分12 应收账款转让通知书1.pdf");
|
||||
map.put("应收账款转让通知书 回执","/supply/部分13 应收账款转让通知书2 回执.pdf");
|
||||
|
||||
String docPath = map.get(docName);
|
||||
|
||||
iFileUtil.download(response,docPath);
|
||||
//更新下载状态
|
||||
StuTransactionDocumentsInfoExample example=new StuTransactionDocumentsInfoExample();
|
||||
example.createCriteria().andUserIdEqualTo(userId).andFileNameEqualTo(docName);
|
||||
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfos = stuTransactionDocumentsInfoMapper.selectByExample(example);
|
||||
if(!stuTransactionDocumentsInfos.isEmpty()){
|
||||
if(category.isEmpty()){
|
||||
stuTransactionDocumentsInfos.get(0).setDownloadStatus(1);
|
||||
}
|
||||
if(category.equals(Constant.CORE_ENTERPRISES)){
|
||||
stuTransactionDocumentsInfos.get(0).setCoreEnterpriseDownloadStatus(1);
|
||||
}
|
||||
if(category.equals(Constant.IMPORT_FACTOR)){
|
||||
stuTransactionDocumentsInfos.get(0).setFactoringDownloadStatus(1);
|
||||
}
|
||||
stuTransactionDocumentsInfos.get(0).setDownloadStatus(1);
|
||||
stuTransactionDocumentsInfoMapper.updateByPrimaryKey(stuTransactionDocumentsInfos.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/upload")
|
||||
@AnonymousAccess
|
||||
@ApiOperation("操作:上传")
|
||||
public ResultEntity upload(@RequestParam @RequestPart MultipartFile file,
|
||||
@RequestParam String userId,
|
||||
@RequestParam(required = false)@ApiParam("企业类别") String category,
|
||||
@ApiParam("文件名")@RequestParam @NotBlank String fileName){
|
||||
|
||||
//判断用户是否已下载
|
||||
StuTransactionDocumentsInfoExample stuTransactionDocumentsInfoExample=new StuTransactionDocumentsInfoExample();
|
||||
stuTransactionDocumentsInfoExample.createCriteria().andUserIdEqualTo(userId).andFileNameEqualTo(fileName);
|
||||
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfos = stuTransactionDocumentsInfoMapper.selectByExample(stuTransactionDocumentsInfoExample);
|
||||
if(!stuTransactionDocumentsInfos.isEmpty()){
|
||||
Integer downloadStatus = stuTransactionDocumentsInfos.get(0).getDownloadStatus();
|
||||
if(downloadStatus!=1){
|
||||
throw new ServiceException(HttpStatus.ACCEPTED,"文件未下载");
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 上传名字做校验防止出现胡乱上传问题待补充
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("应收账款转让通知书 回执","部分13 应收账款转让通知书2 回执");
|
||||
|
||||
//用于判断文件名是否为对应的文件名
|
||||
String name = map.get(fileName);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (file.isEmpty()) {
|
||||
throw new InvoceTException(HttpStatus.ACCEPTED, "请勿上传空文件!");
|
||||
}
|
||||
|
||||
// 获取文件名
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
|
||||
if (!name.equals(originalFilename))
|
||||
{
|
||||
throw new InvoceTException(HttpStatus.ACCEPTED, "请上传正确的文件!");
|
||||
}
|
||||
|
||||
|
||||
// 判断文件扩展名是否为图片格式
|
||||
|
||||
if (!StringUtils.hasLength(originalFilename) || (!originalFilename.toLowerCase().endsWith(".pdf")))
|
||||
{
|
||||
throw new InvoceTException(HttpStatus.ACCEPTED, "请上传正确的文件!");
|
||||
}
|
||||
|
||||
|
||||
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||
example.createCriteria().andUserIdEqualTo(userId).andFileNameEqualTo(fileName);
|
||||
|
||||
|
||||
List<StuTransactionDocumentsInfo> documentsInfoList = stuTransactionDocumentsInfoMapper.selectByExample(example);
|
||||
|
||||
|
||||
String uploadPath = iFileUtil.upload(file);
|
||||
|
||||
|
||||
if (!documentsInfoList.isEmpty()){
|
||||
|
||||
StuTransactionDocumentsInfo documentsInfo = documentsInfoList.get(0);
|
||||
documentsInfo.setUrl(uploadPath);
|
||||
documentsInfo.setUpdateTime(new Date());
|
||||
if(category.isEmpty()){
|
||||
documentsInfo.setUploadStatus(1);
|
||||
}
|
||||
if(category.equals(Constant.CORE_ENTERPRISES)){
|
||||
documentsInfo.setCoreEnterpriseUploadStatus(1);
|
||||
}
|
||||
if(category.equals(Constant.IMPORT_FACTOR)){
|
||||
documentsInfo.setFactoringUploadStatus(1);
|
||||
}
|
||||
|
||||
stuTransactionDocumentsInfoMapper.updateByPrimaryKeySelective(documentsInfo);
|
||||
|
||||
}
|
||||
return new ResultEntity<>(HttpStatus.OK, "上传成功",uploadPath);
|
||||
}
|
||||
|
||||
@PostMapping("/read")
|
||||
@AnonymousAccess
|
||||
@ApiOperation("操作:读取")
|
||||
public ResultEntity read(@RequestParam @ApiParam("文件ID") Integer id){
|
||||
int result=stuDebtTransferStartService.operate(id);
|
||||
if(result>0){
|
||||
return new ResultEntity<>(HttpStatus.OK,"读取成功");
|
||||
}else {
|
||||
return new ResultEntity<>(HttpStatus.OK,"读取失败");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,529 @@
|
||||
<?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.sztzjy.block_finance.mappers.StuDigitalDebtVoucherMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.block_finance.entity.StuDigitalDebtVoucher">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="hash_code" jdbcType="VARCHAR" property="hashCode" />
|
||||
<result column="issuing_part" jdbcType="VARCHAR" property="issuingPart" />
|
||||
<result column="issuing_public_key" jdbcType="VARCHAR" property="issuingPublicKey" />
|
||||
<result column="certificate_part" jdbcType="VARCHAR" property="certificatePart" />
|
||||
<result column="certificate_part_public_key" jdbcType="VARCHAR" property="certificatePartPublicKey" />
|
||||
<result column="acceptor_part" jdbcType="VARCHAR" property="acceptorPart" />
|
||||
<result column="acceptor_part_public_key" jdbcType="VARCHAR" property="acceptorPartPublicKey" />
|
||||
<result column="bond_amount" jdbcType="VARCHAR" property="bondAmount" />
|
||||
<result column="bond_amount_up" jdbcType="VARCHAR" property="bondAmountUp" />
|
||||
<result column="note" jdbcType="VARCHAR" property="note" />
|
||||
<result column="date_confirm" jdbcType="TIMESTAMP" property="dateConfirm" />
|
||||
<result column="signature_confirm" jdbcType="VARCHAR" property="signatureConfirm" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="excessive" jdbcType="VARCHAR" property="excessive" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="encry_state" jdbcType="INTEGER" property="encryState" />
|
||||
<result column="decry_state" jdbcType="INTEGER" property="decryState" />
|
||||
<result column="supplier_digital_signature" jdbcType="VARCHAR" property="supplierDigitalSignature" />
|
||||
<result column="import_factor_digital_signature" jdbcType="VARCHAR" property="importFactorDigitalSignature" />
|
||||
<result column="core_enterprises_digital_signature" jdbcType="VARCHAR" property="coreEnterprisesDigitalSignature" />
|
||||
<result column="factoring_financing_amount" jdbcType="DECIMAL" property="factoringFinancingAmount" />
|
||||
<result column="exchange_token_amount" jdbcType="DECIMAL" property="exchangeTokenAmount" />
|
||||
<result column="remaining_amount" jdbcType="DECIMAL" property="remainingAmount" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, hash_code, issuing_part, issuing_public_key, certificate_part, certificate_part_public_key,
|
||||
acceptor_part, acceptor_part_public_key, bond_amount, bond_amount_up, note, date_confirm,
|
||||
signature_confirm, create_time, update_time, excessive, user_id, encry_state, decry_state,
|
||||
supplier_digital_signature, import_factor_digital_signature, core_enterprises_digital_signature,
|
||||
factoring_financing_amount, exchange_token_amount, remaining_amount
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucherExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_digital_debt_voucher
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_digital_debt_voucher
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from stu_digital_debt_voucher
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucherExample">
|
||||
delete from stu_digital_debt_voucher
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucher">
|
||||
insert into stu_digital_debt_voucher (id, hash_code, issuing_part,
|
||||
issuing_public_key, certificate_part, certificate_part_public_key,
|
||||
acceptor_part, acceptor_part_public_key, bond_amount,
|
||||
bond_amount_up, note, date_confirm,
|
||||
signature_confirm, create_time, update_time,
|
||||
excessive, user_id, encry_state,
|
||||
decry_state, supplier_digital_signature, import_factor_digital_signature,
|
||||
core_enterprises_digital_signature, factoring_financing_amount,
|
||||
exchange_token_amount, remaining_amount)
|
||||
values (#{id,jdbcType=VARCHAR}, #{hashCode,jdbcType=VARCHAR}, #{issuingPart,jdbcType=VARCHAR},
|
||||
#{issuingPublicKey,jdbcType=VARCHAR}, #{certificatePart,jdbcType=VARCHAR}, #{certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
#{acceptorPart,jdbcType=VARCHAR}, #{acceptorPartPublicKey,jdbcType=VARCHAR}, #{bondAmount,jdbcType=VARCHAR},
|
||||
#{bondAmountUp,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{dateConfirm,jdbcType=TIMESTAMP},
|
||||
#{signatureConfirm,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
||||
#{excessive,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{encryState,jdbcType=INTEGER},
|
||||
#{decryState,jdbcType=INTEGER}, #{supplierDigitalSignature,jdbcType=VARCHAR}, #{importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
#{coreEnterprisesDigitalSignature,jdbcType=VARCHAR}, #{factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
#{exchangeTokenAmount,jdbcType=DECIMAL}, #{remainingAmount,jdbcType=DECIMAL})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucher">
|
||||
insert into stu_digital_debt_voucher
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="hashCode != null">
|
||||
hash_code,
|
||||
</if>
|
||||
<if test="issuingPart != null">
|
||||
issuing_part,
|
||||
</if>
|
||||
<if test="issuingPublicKey != null">
|
||||
issuing_public_key,
|
||||
</if>
|
||||
<if test="certificatePart != null">
|
||||
certificate_part,
|
||||
</if>
|
||||
<if test="certificatePartPublicKey != null">
|
||||
certificate_part_public_key,
|
||||
</if>
|
||||
<if test="acceptorPart != null">
|
||||
acceptor_part,
|
||||
</if>
|
||||
<if test="acceptorPartPublicKey != null">
|
||||
acceptor_part_public_key,
|
||||
</if>
|
||||
<if test="bondAmount != null">
|
||||
bond_amount,
|
||||
</if>
|
||||
<if test="bondAmountUp != null">
|
||||
bond_amount_up,
|
||||
</if>
|
||||
<if test="note != null">
|
||||
note,
|
||||
</if>
|
||||
<if test="dateConfirm != null">
|
||||
date_confirm,
|
||||
</if>
|
||||
<if test="signatureConfirm != null">
|
||||
signature_confirm,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="excessive != null">
|
||||
excessive,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="encryState != null">
|
||||
encry_state,
|
||||
</if>
|
||||
<if test="decryState != null">
|
||||
decry_state,
|
||||
</if>
|
||||
<if test="supplierDigitalSignature != null">
|
||||
supplier_digital_signature,
|
||||
</if>
|
||||
<if test="importFactorDigitalSignature != null">
|
||||
import_factor_digital_signature,
|
||||
</if>
|
||||
<if test="coreEnterprisesDigitalSignature != null">
|
||||
core_enterprises_digital_signature,
|
||||
</if>
|
||||
<if test="factoringFinancingAmount != null">
|
||||
factoring_financing_amount,
|
||||
</if>
|
||||
<if test="exchangeTokenAmount != null">
|
||||
exchange_token_amount,
|
||||
</if>
|
||||
<if test="remainingAmount != null">
|
||||
remaining_amount,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="hashCode != null">
|
||||
#{hashCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="issuingPart != null">
|
||||
#{issuingPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="issuingPublicKey != null">
|
||||
#{issuingPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="certificatePart != null">
|
||||
#{certificatePart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="certificatePartPublicKey != null">
|
||||
#{certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="acceptorPart != null">
|
||||
#{acceptorPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="acceptorPartPublicKey != null">
|
||||
#{acceptorPartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bondAmount != null">
|
||||
#{bondAmount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bondAmountUp != null">
|
||||
#{bondAmountUp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="note != null">
|
||||
#{note,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dateConfirm != null">
|
||||
#{dateConfirm,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="signatureConfirm != null">
|
||||
#{signatureConfirm,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="excessive != null">
|
||||
#{excessive,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="encryState != null">
|
||||
#{encryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="decryState != null">
|
||||
#{decryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="supplierDigitalSignature != null">
|
||||
#{supplierDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="importFactorDigitalSignature != null">
|
||||
#{importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="coreEnterprisesDigitalSignature != null">
|
||||
#{coreEnterprisesDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="factoringFinancingAmount != null">
|
||||
#{factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="exchangeTokenAmount != null">
|
||||
#{exchangeTokenAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remainingAmount != null">
|
||||
#{remainingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucherExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_digital_debt_voucher
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_digital_debt_voucher
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.hashCode != null">
|
||||
hash_code = #{record.hashCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.issuingPart != null">
|
||||
issuing_part = #{record.issuingPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.issuingPublicKey != null">
|
||||
issuing_public_key = #{record.issuingPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.certificatePart != null">
|
||||
certificate_part = #{record.certificatePart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.certificatePartPublicKey != null">
|
||||
certificate_part_public_key = #{record.certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.acceptorPart != null">
|
||||
acceptor_part = #{record.acceptorPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.acceptorPartPublicKey != null">
|
||||
acceptor_part_public_key = #{record.acceptorPartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.bondAmount != null">
|
||||
bond_amount = #{record.bondAmount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.bondAmountUp != null">
|
||||
bond_amount_up = #{record.bondAmountUp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.note != null">
|
||||
note = #{record.note,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.dateConfirm != null">
|
||||
date_confirm = #{record.dateConfirm,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.signatureConfirm != null">
|
||||
signature_confirm = #{record.signatureConfirm,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.excessive != null">
|
||||
excessive = #{record.excessive,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.encryState != null">
|
||||
encry_state = #{record.encryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.decryState != null">
|
||||
decry_state = #{record.decryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.supplierDigitalSignature != null">
|
||||
supplier_digital_signature = #{record.supplierDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.importFactorDigitalSignature != null">
|
||||
import_factor_digital_signature = #{record.importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.coreEnterprisesDigitalSignature != null">
|
||||
core_enterprises_digital_signature = #{record.coreEnterprisesDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.factoringFinancingAmount != null">
|
||||
factoring_financing_amount = #{record.factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.exchangeTokenAmount != null">
|
||||
exchange_token_amount = #{record.exchangeTokenAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.remainingAmount != null">
|
||||
remaining_amount = #{record.remainingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_digital_debt_voucher
|
||||
set id = #{record.id,jdbcType=VARCHAR},
|
||||
hash_code = #{record.hashCode,jdbcType=VARCHAR},
|
||||
issuing_part = #{record.issuingPart,jdbcType=VARCHAR},
|
||||
issuing_public_key = #{record.issuingPublicKey,jdbcType=VARCHAR},
|
||||
certificate_part = #{record.certificatePart,jdbcType=VARCHAR},
|
||||
certificate_part_public_key = #{record.certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
acceptor_part = #{record.acceptorPart,jdbcType=VARCHAR},
|
||||
acceptor_part_public_key = #{record.acceptorPartPublicKey,jdbcType=VARCHAR},
|
||||
bond_amount = #{record.bondAmount,jdbcType=VARCHAR},
|
||||
bond_amount_up = #{record.bondAmountUp,jdbcType=VARCHAR},
|
||||
note = #{record.note,jdbcType=VARCHAR},
|
||||
date_confirm = #{record.dateConfirm,jdbcType=TIMESTAMP},
|
||||
signature_confirm = #{record.signatureConfirm,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
excessive = #{record.excessive,jdbcType=VARCHAR},
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
encry_state = #{record.encryState,jdbcType=INTEGER},
|
||||
decry_state = #{record.decryState,jdbcType=INTEGER},
|
||||
supplier_digital_signature = #{record.supplierDigitalSignature,jdbcType=VARCHAR},
|
||||
import_factor_digital_signature = #{record.importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
core_enterprises_digital_signature = #{record.coreEnterprisesDigitalSignature,jdbcType=VARCHAR},
|
||||
factoring_financing_amount = #{record.factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
exchange_token_amount = #{record.exchangeTokenAmount,jdbcType=DECIMAL},
|
||||
remaining_amount = #{record.remainingAmount,jdbcType=DECIMAL}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucher">
|
||||
update stu_digital_debt_voucher
|
||||
<set>
|
||||
<if test="hashCode != null">
|
||||
hash_code = #{hashCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="issuingPart != null">
|
||||
issuing_part = #{issuingPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="issuingPublicKey != null">
|
||||
issuing_public_key = #{issuingPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="certificatePart != null">
|
||||
certificate_part = #{certificatePart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="certificatePartPublicKey != null">
|
||||
certificate_part_public_key = #{certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="acceptorPart != null">
|
||||
acceptor_part = #{acceptorPart,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="acceptorPartPublicKey != null">
|
||||
acceptor_part_public_key = #{acceptorPartPublicKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bondAmount != null">
|
||||
bond_amount = #{bondAmount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bondAmountUp != null">
|
||||
bond_amount_up = #{bondAmountUp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="note != null">
|
||||
note = #{note,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dateConfirm != null">
|
||||
date_confirm = #{dateConfirm,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="signatureConfirm != null">
|
||||
signature_confirm = #{signatureConfirm,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="excessive != null">
|
||||
excessive = #{excessive,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="encryState != null">
|
||||
encry_state = #{encryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="decryState != null">
|
||||
decry_state = #{decryState,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="supplierDigitalSignature != null">
|
||||
supplier_digital_signature = #{supplierDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="importFactorDigitalSignature != null">
|
||||
import_factor_digital_signature = #{importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="coreEnterprisesDigitalSignature != null">
|
||||
core_enterprises_digital_signature = #{coreEnterprisesDigitalSignature,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="factoringFinancingAmount != null">
|
||||
factoring_financing_amount = #{factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="exchangeTokenAmount != null">
|
||||
exchange_token_amount = #{exchangeTokenAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remainingAmount != null">
|
||||
remaining_amount = #{remainingAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.block_finance.entity.StuDigitalDebtVoucher">
|
||||
update stu_digital_debt_voucher
|
||||
set hash_code = #{hashCode,jdbcType=VARCHAR},
|
||||
issuing_part = #{issuingPart,jdbcType=VARCHAR},
|
||||
issuing_public_key = #{issuingPublicKey,jdbcType=VARCHAR},
|
||||
certificate_part = #{certificatePart,jdbcType=VARCHAR},
|
||||
certificate_part_public_key = #{certificatePartPublicKey,jdbcType=VARCHAR},
|
||||
acceptor_part = #{acceptorPart,jdbcType=VARCHAR},
|
||||
acceptor_part_public_key = #{acceptorPartPublicKey,jdbcType=VARCHAR},
|
||||
bond_amount = #{bondAmount,jdbcType=VARCHAR},
|
||||
bond_amount_up = #{bondAmountUp,jdbcType=VARCHAR},
|
||||
note = #{note,jdbcType=VARCHAR},
|
||||
date_confirm = #{dateConfirm,jdbcType=TIMESTAMP},
|
||||
signature_confirm = #{signatureConfirm,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
excessive = #{excessive,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
encry_state = #{encryState,jdbcType=INTEGER},
|
||||
decry_state = #{decryState,jdbcType=INTEGER},
|
||||
supplier_digital_signature = #{supplierDigitalSignature,jdbcType=VARCHAR},
|
||||
import_factor_digital_signature = #{importFactorDigitalSignature,jdbcType=VARCHAR},
|
||||
core_enterprises_digital_signature = #{coreEnterprisesDigitalSignature,jdbcType=VARCHAR},
|
||||
factoring_financing_amount = #{factoringFinancingAmount,jdbcType=DECIMAL},
|
||||
exchange_token_amount = #{exchangeTokenAmount,jdbcType=DECIMAL},
|
||||
remaining_amount = #{remainingAmount,jdbcType=DECIMAL}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue