Commit c36c4b45 authored by eddie.woo's avatar eddie.woo

modify

parent c930eef3
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.connectionURL=jdbc:mysql://10.157.107.89:3306/tax_admin?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc.connectionURL=jdbc:mysql://10.157.107.89:3306/tax_longi?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc.userId=root
jdbc.password=tax@Admin2018
......@@ -412,5 +412,18 @@
<property name="useActualColumnNames" value="true"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="input_invoice" domainObjectName="InputInvoice">
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="invoice_type" javaType="java.lang.Integer"/>
<columnOverride column="upload_type" javaType="java.lang.Integer"/>
<columnOverride column="invoice_entity_type" javaType="java.lang.Integer"/>
<columnOverride column="invoice_source_type" javaType="java.lang.Integer"/>
<columnOverride column="status" javaType="java.lang.Integer"/>
<columnOverride column="deductible" javaType="java.lang.Boolean"/>
<columnOverride column="has_down_file" javaType="java.lang.Boolean"/>
<columnOverride column="verify_type" javaType="java.lang.Integer"/>
<columnOverride column="deductible_result" javaType="java.lang.Integer"/>
<columnOverride column="is_red_invoice" javaType="java.lang.Boolean"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose -tables TemplateFormula
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose -tables input_invoice
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
......@@ -233,7 +233,7 @@
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
......
package pwc.taxtech.atms.common.util;
public class SnowFlake {
/**
* 起始的时间戳
*/
private final static long START_STAMP = 1529337600000L;
/**
* 每一部分占用的位数
*/
private final static long SEQUENCE_BIT = 12; //序列号占用的位数
private final static long MACHINE_BIT = 5; //机器标识占用的位数
private final static long DATA_CENTER_BIT = 5;//数据中心占用的位数
/**
* 每一部分的最大值
*/
private final static long MAX_DATA_CENTER_NUM = -1L ^ (-1L << DATA_CENTER_BIT);
private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT);
private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT);
/**
* 每一部分向左的位移
*/
private final static long MACHINE_LEFT = SEQUENCE_BIT;
private final static long DATA_CENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
private final static long TIMESTAMP_LEFT = DATA_CENTER_LEFT + DATA_CENTER_BIT;
private long dataCenterId; //数据中心
private long machineId; //机器标识
private long sequence = 0L; //序列号
private long lastStamp = -1L;//上一次时间戳
public SnowFlake(long dataCenterId, long machineId) {
if (dataCenterId > MAX_DATA_CENTER_NUM || dataCenterId < 0) {
throw new IllegalArgumentException("dataCenterId can't be greater than MAX_DATA_CENTER_NUM or less than 0");
}
if (machineId > MAX_MACHINE_NUM || machineId < 0) {
throw new IllegalArgumentException("machineId can't be greater than MAX_MACHINE_NUM or less than 0");
}
this.dataCenterId = dataCenterId;
this.machineId = machineId;
}
/**
* 产生下一个ID
*
* @return id
*/
public synchronized long nextId() {
long currStamp = getNewStamp();
if (currStamp < lastStamp) {
throw new RuntimeException("Clock moved backwards. Refusing to generate id");
}
if (currStamp == lastStamp) {
//相同毫秒内,序列号自增
sequence = (sequence + 1) & MAX_SEQUENCE;
//同一毫秒的序列数已经达到最大
if (sequence == 0L) {
currStamp = getNextMill();
}
} else {
//不同毫秒内,序列号置为0
sequence = 0L;
}
lastStamp = currStamp;
return (currStamp - START_STAMP) << TIMESTAMP_LEFT //时间戳部分
| dataCenterId << DATA_CENTER_LEFT //数据中心部分
| machineId << MACHINE_LEFT //机器标识部分
| sequence; //序列号部分
}
private long getNextMill() {
long mill = getNewStamp();
while (mill <= lastStamp) {
mill = getNewStamp();
}
return mill;
}
private long getNewStamp() {
return System.currentTimeMillis();
}
public static void main(String[] args) {
SnowFlake snowFlake = new SnowFlake(1, 1);
for (int i = 0; i < (1 << 12); i++) {
System.out.println(snowFlake.nextId());
}
}
}
package pwc.taxtech.atms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entitiy.InputInvoice;
import pwc.taxtech.atms.entitiy.InputInvoiceExample;
@Mapper
public interface InputInvoiceMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
long countByExample(InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int deleteByExample(InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int insert(InputInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int insertSelective(InputInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List<InputInvoice> selectByExampleWithBLOBsWithRowbounds(InputInvoiceExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List<InputInvoice> selectByExampleWithBLOBs(InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List<InputInvoice> selectByExampleWithRowbounds(InputInvoiceExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List<InputInvoice> selectByExample(InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
InputInvoice selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") InputInvoice record, @Param("example") InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") InputInvoice record, @Param("example") InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByExample(@Param("record") InputInvoice record, @Param("example") InputInvoiceExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(InputInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(InputInvoice record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int updateByPrimaryKey(InputInvoice record);
}
\ No newline at end of file
package pwc.taxtech.atms.service.impl;
public class DistributedIDService {
}
jdbc_url=jdbc:mysql://10.157.107.89:3306/tax_admin?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true
jdbc_url=jdbc:mysql://10.157.107.89:3306/tax_longi?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true
jdbc_user=root
jdbc_password=tax@Admin2018
jdbc_admin_db=tax_admin
......
jdbc_url=jdbc:mysql://10.157.107.89:3306/tax_admin?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true
jdbc_url=jdbc:mysql://10.157.107.89:3306/tax_longi?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true
jdbc_user=root
jdbc_password=tax@Admin2018
jdbc_admin_db=tax_admin
......
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