修改上链问题

master
whb 11 months ago
parent 20954aa155
commit d4a3340972

@ -3,8 +3,8 @@ package com.sztzjy.block_finance.controller;
import com.nimbusds.jose.shaded.gson.Gson;
import com.sztzjy.block_finance.annotation.AnonymousAccess;
import com.sztzjy.block_finance.config.security.TokenProvider;
import com.sztzjy.block_finance.entity.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuPracticalTrainingReport;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import com.sztzjy.block_finance.entity.StuSupplyScore;
import com.sztzjy.block_finance.entity.dto.StuBlockProductWithBLOBs;
import com.sztzjy.block_finance.entity.dto.StuOnChainInfoDTO;
@ -161,11 +161,11 @@ public class StuPublicModuleController {
@GetMapping("/getTrace")
@ApiOperation("3.发票溯源")
@AnonymousAccess
public ResultEntity<List<StuBlockOnChain>> getTrace(String numbers, String userId) {
public ResultEntity<List<StuSupplyOnchain>> getTrace(String numbers, String userId) {
List<StuBlockOnChain> info = publicService.getTrace(numbers, userId);
List<StuSupplyOnchain> info = publicService.getTrace(numbers, userId);
return new ResultEntity<List<StuBlockOnChain>>(HttpStatus.OK, info);
return new ResultEntity<List<StuSupplyOnchain>>(HttpStatus.OK, info);
}

@ -1,6 +1,6 @@
package com.sztzjy.block_finance.entity;
public class StuBlockOnChain {
public class StuSupplyOnchain {
private String id;
private String chainName;

@ -3,14 +3,14 @@ package com.sztzjy.block_finance.entity;
import java.util.ArrayList;
import java.util.List;
public class StuBlockOnChainExample {
public class StuSupplyOnchainExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuBlockOnChainExample() {
public StuSupplyOnchainExample() {
oredCriteria = new ArrayList<>();
}

@ -1,6 +1,6 @@
package com.sztzjy.block_finance.entity.dto;
import com.sztzjy.block_finance.entity.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import lombok.Data;
import java.util.List;
@ -18,7 +18,7 @@ public class StuOnChainInfoDTO {
//区块链
private List<StuBlockOnChain> stuBlockOnChains;
private List<StuSupplyOnchain> stuBlockOnChains;
}

@ -1,35 +0,0 @@
package com.sztzjy.block_finance.mappers;
import com.sztzjy.block_finance.entity.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuBlockOnChainExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuBlockOnChainMapper {
long countByExample(StuBlockOnChainExample example);
int deleteByExample(StuBlockOnChainExample example);
int deleteByPrimaryKey(String id);
int insert(StuBlockOnChain record);
int insertSelective(StuBlockOnChain record);
List<StuBlockOnChain> selectByExample(StuBlockOnChainExample example);
StuBlockOnChain selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") StuBlockOnChain record, @Param("example") StuBlockOnChainExample example);
int updateByExample(@Param("record") StuBlockOnChain record, @Param("example") StuBlockOnChainExample example);
int updateByPrimaryKeySelective(StuBlockOnChain record);
int updateByPrimaryKey(StuBlockOnChain record);
//
StuBlockOnChain selectByTime(String userId);
}

@ -0,0 +1,35 @@
package com.sztzjy.block_finance.mappers;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import com.sztzjy.block_finance.entity.StuSupplyOnchainExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuSupplyOnchainMapper {
long countByExample(StuSupplyOnchainExample example);
int deleteByExample(StuSupplyOnchainExample example);
int deleteByPrimaryKey(String id);
int insert(StuSupplyOnchain record);
int insertSelective(StuSupplyOnchain record);
List<StuSupplyOnchain> selectByExample(StuSupplyOnchainExample example);
StuSupplyOnchain selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") StuSupplyOnchain record, @Param("example") StuSupplyOnchainExample example);
int updateByExample(@Param("record") StuSupplyOnchain record, @Param("example") StuSupplyOnchainExample example);
int updateByPrimaryKeySelective(StuSupplyOnchain record);
int updateByPrimaryKey(StuSupplyOnchain record);
StuSupplyOnchain selectByTime(String userId);
}

@ -1,11 +1,10 @@
package com.sztzjy.block_finance.service;
import com.sztzjy.block_finance.entity.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuPracticalTrainingReport;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import com.sztzjy.block_finance.entity.StuSupplyScore;
import com.sztzjy.block_finance.entity.dto.StuBlockProductWithBLOBs;
import com.sztzjy.block_finance.entity.dto.StuOnChainInfoDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
@ -50,5 +49,5 @@ public interface StuPublicService {
StuOnChainInfoDTO getOnChain(String userId);
List<StuBlockOnChain> getTrace(String numbers, String userId);
List<StuSupplyOnchain> getTrace(String numbers, String userId);
}

@ -11,12 +11,11 @@ import com.sztzjy.block_finance.config.exception.handler.ServiceException;
import com.sztzjy.block_finance.entity.*;
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
import com.sztzjy.block_finance.mappers.StuBlockOnChainMapper;
import com.sztzjy.block_finance.mappers.StuDigitalDebtVoucherMapper;
import com.sztzjy.block_finance.mappers.StuSupplyOnchainMapper;
import com.sztzjy.block_finance.service.StuDigitalDebtVoucherService;
import com.sztzjy.block_finance.util.ResultEntity;
import com.sztzjy.block_finance.util.RsaUtil;
import org.apache.http.protocol.HTTP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
@ -34,7 +33,7 @@ public class StuDigitalDebtVoucherServiceImpl implements StuDigitalDebtVoucherSe
private StuDigitalDebtVoucherMapper mapper;
@Autowired
private StuBlockOnChainMapper stuBlockOnChainMapper;
private StuSupplyOnchainMapper stuBlockOnChainMapper;
/**
@ -206,9 +205,9 @@ public class StuDigitalDebtVoucherServiceImpl implements StuDigitalDebtVoucherSe
//上链
//根据时间获取上一条加密数据,将数据加密,
StuBlockOnChainExample onChainExample = new StuBlockOnChainExample();
StuSupplyOnchainExample onChainExample = new StuSupplyOnchainExample();
onChainExample.createCriteria().andUserIdEqualTo(dto.getUserId());
List<StuBlockOnChain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
List<StuSupplyOnchain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
if (!blockOnChainList.isEmpty()){
//通过hash256将加密数据生成区块哈希
@ -216,8 +215,8 @@ public class StuDigitalDebtVoucherServiceImpl implements StuDigitalDebtVoucherSe
//追加在上一个区块链后面
StuBlockOnChain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuBlockOnChain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
StuSupplyOnchain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuSupplyOnchain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
Integer sequence = onChain.getSequence();
@ -232,7 +231,7 @@ public class StuDigitalDebtVoucherServiceImpl implements StuDigitalDebtVoucherSe
// 根据原始字符串的格式构建新的字符串(保持数字部分的格式)
String newString = chainName.replaceAll("\\d+", String.format("%1d", number));
StuBlockOnChain chain = new StuBlockOnChain();
StuSupplyOnchain chain = new StuSupplyOnchain();
chain.setBlockIndex(onChain.getBlockIndex() + 1);
chain.setChainName(newString);

@ -3,24 +3,17 @@ package com.sztzjy.block_finance.service.impl;/**
* @date 2024-03-21 15:58
*/
import cn.hutool.core.lang.hash.Hash;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.crypto.digest.MD5;
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.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuBlockOnChainExample;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import com.sztzjy.block_finance.entity.StuSupplyOnchainExample;
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
import com.sztzjy.block_finance.mappers.StuBlockOnChainMapper;
import com.sztzjy.block_finance.mappers.StuSupplyOnchainMapper;
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
import com.sztzjy.block_finance.service.StuEncryptOnChainService;
import com.sztzjy.block_finance.util.ResultEntity;
@ -29,14 +22,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.security.NoSuchAlgorithmException;
import java.util.*;
@Service
public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
@Autowired
private StuBlockOnChainMapper stuBlockOnChainMapper;
private StuSupplyOnchainMapper stuBlockOnChainMapper;
@ -125,14 +117,14 @@ public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
//判断是否已存在区块(如果没有添加创世区块并追加在创世区块链后面,有则添加下一个)
StuBlockOnChainExample onChainExample = new StuBlockOnChainExample();
StuSupplyOnchainExample onChainExample = new StuSupplyOnchainExample();
onChainExample.createCriteria().andUserIdEqualTo(dto.getUserId());
List<StuBlockOnChain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
List<StuSupplyOnchain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
//是否存在
if (blockOnChainList.size() == 0) {
//添加创世区块
StuBlockOnChain blockOnChain = new StuBlockOnChain();
StuSupplyOnchain blockOnChain = new StuSupplyOnchain();
//添加默认高度为1
blockOnChain.setBlockIndex(1);
blockOnChain.setChainName("区块0 创世区块");
@ -146,11 +138,11 @@ public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
//追加在上一个区块链后面
StuBlockOnChain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuSupplyOnchain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuBlockOnChain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
StuSupplyOnchain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
StuBlockOnChain stuBlockOnChain = new StuBlockOnChain();
StuSupplyOnchain stuBlockOnChain = new StuSupplyOnchain();
stuBlockOnChain.setBlockIndex(2);
stuBlockOnChain.setChainName("区块1");
@ -165,9 +157,9 @@ public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
} else {
//追加在上一个区块链后面
StuBlockOnChain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuSupplyOnchain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuBlockOnChain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
StuSupplyOnchain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
String chainName = onChain.getChainName();
@ -180,7 +172,7 @@ public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
// 根据原始字符串的格式构建新的字符串(保持数字部分的格式)
String newString = chainName.replaceAll("\\d+", String.format("%1d", number));
StuBlockOnChain chain = new StuBlockOnChain();
StuSupplyOnchain chain = new StuSupplyOnchain();
chain.setBlockIndex(onChain.getBlockIndex() + 1);
chain.setChainName(newString);

@ -59,7 +59,7 @@ public class StuPublicServiceImpl implements StuPublicService {
private IFileUtil iFileUtil;
@Autowired
private StuBlockOnChainMapper stuBlockOnChainMapper;
private StuSupplyOnchainMapper stuBlockOnChainMapper;
/**
*
@ -387,10 +387,10 @@ public class StuPublicServiceImpl implements StuPublicService {
@Override
public StuOnChainInfoDTO getOnChain(String userId) {
StuBlockOnChainExample onChainExample = new StuBlockOnChainExample();
StuSupplyOnchainExample onChainExample = new StuSupplyOnchainExample();
onChainExample.createCriteria().andUserIdEqualTo(userId);
onChainExample.setOrderByClause("block_index asc");
List<StuBlockOnChain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
List<StuSupplyOnchain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
StuOnChainInfoDTO stuOnChainInfoDTO = new StuOnChainInfoDTO();
stuOnChainInfoDTO.setNodeNumber(blockOnChainList.size());
@ -399,15 +399,15 @@ public class StuPublicServiceImpl implements StuPublicService {
}
@Override
public List<StuBlockOnChain> getTrace(String numbers, String userId) {
public List<StuSupplyOnchain> getTrace(String numbers, String userId) {
//返回链表数据
List<StuBlockOnChain> stuBlockOnChainArrayList = new ArrayList<>();
List<StuSupplyOnchain> stuBlockOnChainArrayList = new ArrayList<>();
//根据报税单号查询
StuBlockOnChainExample onChainExample = new StuBlockOnChainExample();
StuSupplyOnchainExample onChainExample = new StuSupplyOnchainExample();
onChainExample.createCriteria().andUserIdEqualTo(userId).andPlanNumberEqualTo(numbers);
onChainExample.setOrderByClause("sequence asc");
List<StuBlockOnChain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
List<StuSupplyOnchain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
if (blockOnChainList.size() == 0)
{

@ -3,24 +3,22 @@ package com.sztzjy.block_finance.service.impl;/**
* @date 2024-04-09 11:34
*/
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.digest.DigestUtil;
import com.sztzjy.block_finance.config.Constant;
import com.sztzjy.block_finance.config.exception.handler.ServiceException;
import com.sztzjy.block_finance.entity.StuBlockOnChain;
import com.sztzjy.block_finance.entity.StuBlockOnChainExample;
import com.sztzjy.block_finance.entity.StuSupplyOnchain;
import com.sztzjy.block_finance.entity.StuSupplyOnchainExample;
import com.sztzjy.block_finance.entity.StuUploadResourceInfo;
import com.sztzjy.block_finance.entity.StuUploadResourceInfoExample;
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
import com.sztzjy.block_finance.mappers.StuBlockOnChainMapper;
import com.sztzjy.block_finance.mappers.StuSupplyOnchainMapper;
import com.sztzjy.block_finance.mappers.StuUploadResourceInfoMapper;
import com.sztzjy.block_finance.service.StuSignFactorContractService;
import com.sztzjy.block_finance.util.ResultEntity;
import com.sztzjy.block_finance.util.RsaUtil;
import com.sztzjy.block_finance.util.file.IFileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
@ -38,7 +36,7 @@ public class StuSignFactorContractServiceImpl implements StuSignFactorContractSe
private StuUploadResourceInfoMapper stuUploadResourceInfoMapper;
@Autowired
private StuBlockOnChainMapper stuBlockOnChainMapper;
private StuSupplyOnchainMapper stuBlockOnChainMapper;
@ -197,14 +195,14 @@ public class StuSignFactorContractServiceImpl implements StuSignFactorContractSe
//上链
//根据时间获取上一条加密数据,将数据加密,
StuBlockOnChainExample onChainExample = new StuBlockOnChainExample();
StuSupplyOnchainExample onChainExample = new StuSupplyOnchainExample();
onChainExample.createCriteria().andUserIdEqualTo(dto.getUserId());
List<StuBlockOnChain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
List<StuSupplyOnchain> blockOnChainList = stuBlockOnChainMapper.selectByExample(onChainExample);
if (!blockOnChainList.isEmpty()){
//追加在上一个区块链后面
StuBlockOnChain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuBlockOnChain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
StuSupplyOnchain stuBlockOnChain1 = stuBlockOnChainMapper.selectByTime(dto.getUserId());
StuSupplyOnchain onChain = stuBlockOnChainMapper.selectByPrimaryKey(stuBlockOnChain1.getId());
Integer sequence = onChain.getSequence();
@ -219,7 +217,7 @@ public class StuSignFactorContractServiceImpl implements StuSignFactorContractSe
// 根据原始字符串的格式构建新的字符串(保持数字部分的格式)
String newString = chainName.replaceAll("\\d+", String.format("%1d", number));
StuBlockOnChain chain = new StuBlockOnChain();
StuSupplyOnchain chain = new StuSupplyOnchain();
chain.setBlockIndex(onChain.getBlockIndex() + 1);
chain.setChainName(newString);

@ -1,7 +1,7 @@
<?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.StuBlockOnChainMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.block_finance.entity.StuBlockOnChain">
<mapper namespace="com.sztzjy.block_finance.mappers.StuSupplyOnchainMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.block_finance.entity.StuSupplyOnchain">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="chain_name" jdbcType="VARCHAR" property="chainName" />
<result column="block_hash" jdbcType="VARCHAR" property="blockHash" />
@ -76,13 +76,13 @@
id, chain_name, block_hash, chain_time, pre_block_hash, buy_data, tax_number, sequence,
user_id, plan_number, block_index
</sql>
<select id="selectByExample" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChainExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchainExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_block_onchain
from stu_supply_onchain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -93,21 +93,21 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_block_onchain
from stu_supply_onchain
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_block_onchain
delete from stu_supply_onchain
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChainExample">
delete from stu_block_onchain
<delete id="deleteByExample" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchainExample">
delete from stu_supply_onchain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChain">
insert into stu_block_onchain (id, chain_name, block_hash,
<insert id="insert" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchain">
insert into stu_supply_onchain (id, chain_name, block_hash,
chain_time, pre_block_hash, buy_data,
tax_number, sequence, user_id,
plan_number, block_index)
@ -116,8 +116,8 @@
#{taxNumber,jdbcType=VARCHAR}, #{sequence,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR},
#{planNumber,jdbcType=VARCHAR}, #{blockIndex,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChain">
insert into stu_block_onchain
<insert id="insertSelective" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchain">
insert into stu_supply_onchain
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
@ -189,15 +189,14 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChainExample" resultType="java.lang.Long">
select count(*) from stu_block_onchain
<select id="countByExample" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchainExample" resultType="java.lang.Long">
select count(*) from stu_supply_onchain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_block_onchain
<update id="updateByExampleSelective" parameterType="map">
update stu_supply_onchain
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
@ -238,7 +237,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_block_onchain
update stu_supply_onchain
set id = #{record.id,jdbcType=VARCHAR},
chain_name = #{record.chainName,jdbcType=VARCHAR},
block_hash = #{record.blockHash,jdbcType=VARCHAR},
@ -254,8 +253,8 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChain">
update stu_block_onchain
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchain">
update stu_supply_onchain
<set>
<if test="chainName != null">
chain_name = #{chainName,jdbcType=VARCHAR},
@ -290,8 +289,8 @@
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.block_finance.entity.StuBlockOnChain">
update stu_block_onchain
<update id="updateByPrimaryKey" parameterType="com.sztzjy.block_finance.entity.StuSupplyOnchain">
update stu_supply_onchain
set chain_name = #{chainName,jdbcType=VARCHAR},
block_hash = #{blockHash,jdbcType=VARCHAR},
chain_time = #{chainTime,jdbcType=BIGINT},
@ -306,11 +305,11 @@
</update>
<select id="selectByTime" resultType="com.sztzjy.block_finance.entity.StuBlockOnChain">
<select id="selectByTime" resultType="com.sztzjy.block_finance.entity.StuSupplyOnchain">
select id, chain_name, block_hash, chain_time, pre_block_hash, buy_data, tax_number, sequence,
user_id, plan_number, block_index from stu_block_onchain order by chain_time desc limit 1;
</select>
</mapper>
Loading…
Cancel
Save