Commit d53783a9 authored by jmdhappy's avatar jmdhappy
Browse files

初始化提交

parent 324ccaaf
package org.xxpay.dal.dao.plugin;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.*;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;
import java.util.List;
/**
* @Description: MySql分页插件
* @author dingzhiwei jmdhappy@126.com
* @date 2017-07-05
* @version V1.0
* @Copyright: www.xxpay.org
*/
public class PaginationPlugin extends PluginAdapter {
@Override
public boolean validate(List<String> list) {
return true;
}
/**
* 为每个Example类添加limit和offset属性和set、get方法
*/
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
PrimitiveTypeWrapper integerWrapper = FullyQualifiedJavaType.getIntInstance().getPrimitiveTypeWrapper();
Field limit = new Field();
limit.setName("limit");
limit.setVisibility(JavaVisibility.PRIVATE);
limit.setType(integerWrapper);
topLevelClass.addField(limit);
Method setLimit = new Method();
setLimit.setVisibility(JavaVisibility.PUBLIC);
setLimit.setName("setLimit");
setLimit.addParameter(new Parameter(integerWrapper, "limit"));
setLimit.addBodyLine("this.limit = limit;");
topLevelClass.addMethod(setLimit);
Method getLimit = new Method();
getLimit.setVisibility(JavaVisibility.PUBLIC);
getLimit.setReturnType(integerWrapper);
getLimit.setName("getLimit");
getLimit.addBodyLine("return limit;");
topLevelClass.addMethod(getLimit);
Field offset = new Field();
offset.setName("offset");
offset.setVisibility(JavaVisibility.PRIVATE);
offset.setType(integerWrapper);
topLevelClass.addField(offset);
Method setOffset = new Method();
setOffset.setVisibility(JavaVisibility.PUBLIC);
setOffset.setName("setOffset");
setOffset.addParameter(new Parameter(integerWrapper, "offset"));
setOffset.addBodyLine("this.offset = offset;");
topLevelClass.addMethod(setOffset);
Method getOffset = new Method();
getOffset.setVisibility(JavaVisibility.PUBLIC);
getOffset.setReturnType(integerWrapper);
getOffset.setName("getOffset");
getOffset.addBodyLine("return offset;");
topLevelClass.addMethod(getOffset);
return true;
}
/**
* 为Mapper.xml的selectByExample添加limit,offset
*/
@Override
public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element,
IntrospectedTable introspectedTable) {
XmlElement ifLimitNotNullElement = new XmlElement("if");
ifLimitNotNullElement.addAttribute(new Attribute("test", "limit != null"));
XmlElement ifOffsetNotNullElement = new XmlElement("if");
ifOffsetNotNullElement.addAttribute(new Attribute("test", "offset != null"));
ifOffsetNotNullElement.addElement(new TextElement("limit ${offset}, ${limit}"));
ifLimitNotNullElement.addElement(ifOffsetNotNullElement);
XmlElement ifOffsetNullElement = new XmlElement("if");
ifOffsetNullElement.addAttribute(new Attribute("test", "offset == null"));
ifOffsetNullElement.addElement(new TextElement("limit ${limit}"));
ifLimitNotNullElement.addElement(ifOffsetNullElement);
element.addElement(ifLimitNotNullElement);
return true;
}
}
package org.xxpay.dal.dao.plugin;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.*;
import java.util.List;
import java.util.Properties;
/**
* @Description: Example类和model类实现序列化插件
* @author dingzhiwei jmdhappy@126.com
* @date 2017-07-05
* @version V1.0
* @Copyright: www.xxpay.org
*/
public class SerializablePlugin extends PluginAdapter {
private FullyQualifiedJavaType serializable = new FullyQualifiedJavaType("java.io.Serializable");
private FullyQualifiedJavaType gwtSerializable = new FullyQualifiedJavaType("com.google.gwt.user.client.rpc.IsSerializable");
private boolean addGWTInterface;
private boolean suppressJavaInterface;
public SerializablePlugin() {
}
public boolean validate(List<String> warnings) {
return true;
}
public void setProperties(Properties properties) {
super.setProperties(properties);
this.addGWTInterface = Boolean.valueOf(properties.getProperty("addGWTInterface")).booleanValue();
this.suppressJavaInterface = Boolean.valueOf(properties.getProperty("suppressJavaInterface")).booleanValue();
}
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
this.makeSerializable(topLevelClass, introspectedTable);
return true;
}
public boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
this.makeSerializable(topLevelClass, introspectedTable);
return true;
}
public boolean modelRecordWithBLOBsClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
this.makeSerializable(topLevelClass, introspectedTable);
return true;
}
protected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
if(this.addGWTInterface) {
topLevelClass.addImportedType(this.gwtSerializable);
topLevelClass.addSuperInterface(this.gwtSerializable);
}
if(!this.suppressJavaInterface) {
topLevelClass.addImportedType(this.serializable);
topLevelClass.addSuperInterface(this.serializable);
Field field = new Field();
field.setFinal(true);
field.setInitializationString("1L");
field.setName("serialVersionUID");
field.setStatic(true);
field.setType(new FullyQualifiedJavaType("long"));
field.setVisibility(JavaVisibility.PRIVATE);
this.context.getCommentGenerator().addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
}
}
/**
* 添加给Example类序列化的方法
* @param topLevelClass
* @param introspectedTable
* @return
*/
@Override
public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable){
makeSerializable(topLevelClass, introspectedTable);
for (InnerClass innerClass : topLevelClass.getInnerClasses()) {
if ("GeneratedCriteria".equals(innerClass.getType().getShortName())) {
innerClass.addSuperInterface(serializable);
}
if ("Criteria".equals(innerClass.getType().getShortName())) {
innerClass.addSuperInterface(serializable);
}
if ("Criterion".equals(innerClass.getType().getShortName())) {
innerClass.addSuperInterface(serializable);
}
}
return true;
}
}
generator.jdbc.driver=com.mysql.jdbc.Driver
generator.jdbc.url=jdbc:mysql://127.0.0.1:3306/xxpaydb?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
generator.jdbc.username=xxpay
generator.jdbc.password=xxpay
classPathEntry=/Users/dingzhiwei/java/repository/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>
<!-- 配置文件 -->
<properties resource="generator.properties"></properties>
<!-- 驱动包 -->
<classPathEntry location="${classPathEntry}" />
<context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
<property name="javaFileEncoding" value="UTF-8"/>
<!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号("),在Mysql中不能这么写,所以还要将这两个默认值改为` -->
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<property name="useActualColumnNames" value="false" />
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
<!-- 为生成的Java模型类添加序列化接口,并生成serialVersionUID字段 -->
<plugin type="org.xxpay.dal.dao.plugin.SerializablePlugin">
<property name="suppressJavaInterface" value="false"/>
</plugin>
<!-- 生成一个新的selectByExample方法,这个方法可以接收offset和limit参数,主要用来实现分页 -->
<plugin type="org.xxpay.dal.dao.plugin.PaginationPlugin"></plugin>
<!-- Java模型生成equals和hashcode方法 -->
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
<!-- 生成的代码去掉注释 -->
<commentGenerator type="org.xxpay.dal.dao.plugin.CommentGenerator">
<property name="suppressAllComments" value="true"/>
<property name="suppressDate" value="true"/>
</commentGenerator>
<!-- 数据库连接 -->
<jdbcConnection driverClass="${generator.jdbc.driver}"
connectionURL="${generator.jdbc.url}"
userId="${generator.jdbc.username}"
password="${generator.jdbc.password}"/>
<!-- model生成 -->
<javaModelGenerator targetPackage="org.xxpay.dal.dao.model" targetProject="src/main/java"/>
<!-- MapperXML生成 -->
<sqlMapGenerator targetPackage="org.xxpay.dal.dao.mapper" targetProject="src/main/resources"/>
<!-- Mapper接口生成 -->
<javaClientGenerator targetPackage="org.xxpay.dal.dao.mapper" targetProject="src/main/java" type="XMLMAPPER"/>
<!-- 需要映射的表 -->
<table tableName="t_pay_order" domainObjectName="PayOrder"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_trans_order" domainObjectName="TransOrder"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_pay_channel" domainObjectName="PayChannel"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_mch_info" domainObjectName="MchInfo"><property name="useActualColumnNames" value="true" /></table>
<table tableName="t_iap_receipt" domainObjectName="IapReceipt"><property name="useActualColumnNames" value="true" /></table>
</context>
</generatorConfiguration>
\ No newline at end of file
<?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="org.xxpay.dal.dao.mapper.IapReceiptMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.IapReceipt" >
<id column="PayOrderId" property="payOrderId" jdbcType="VARCHAR" />
<result column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="TransactionId" property="transactionId" jdbcType="VARCHAR" />
<result column="Status" property="status" jdbcType="TINYINT" />
<result column="HandleCount" property="handleCount" jdbcType="TINYINT" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="org.xxpay.dal.dao.model.IapReceipt" extends="BaseResultMap" >
<result column="ReceiptData" property="receiptData" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
PayOrderId, MchId, TransactionId, Status, HandleCount, CreateTime, UpdateTime
</sql>
<sql id="Blob_Column_List" >
ReceiptData
</sql>
<select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="org.xxpay.dal.dao.model.IapReceiptExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_iap_receipt
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.IapReceiptExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_iap_receipt
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_iap_receipt
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from t_iap_receipt
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.IapReceiptExample" >
delete from t_iap_receipt
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.IapReceipt" >
insert into t_iap_receipt (PayOrderId, MchId, TransactionId,
Status, HandleCount, CreateTime,
UpdateTime, ReceiptData)
values (#{payOrderId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT}, #{handleCount,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{receiptData,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.IapReceipt" >
insert into t_iap_receipt
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="payOrderId != null" >
PayOrderId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="transactionId != null" >
TransactionId,
</if>
<if test="status != null" >
Status,
</if>
<if test="handleCount != null" >
HandleCount,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
<if test="receiptData != null" >
ReceiptData,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="payOrderId != null" >
#{payOrderId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="transactionId != null" >
#{transactionId,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="handleCount != null" >
#{handleCount,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="receiptData != null" >
#{receiptData,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.IapReceiptExample" resultType="java.lang.Integer" >
select count(*) from t_iap_receipt
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_iap_receipt
<set >
<if test="record.payOrderId != null" >
PayOrderId = #{record.payOrderId,jdbcType=VARCHAR},
</if>
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.transactionId != null" >
TransactionId = #{record.transactionId,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
Status = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.handleCount != null" >
HandleCount = #{record.handleCount,jdbcType=TINYINT},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.receiptData != null" >
ReceiptData = #{record.receiptData,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map" >
update t_iap_receipt
set PayOrderId = #{record.payOrderId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
TransactionId = #{record.transactionId,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=TINYINT},
HandleCount = #{record.handleCount,jdbcType=TINYINT},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
ReceiptData = #{record.receiptData,jdbcType=LONGVARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_iap_receipt
set PayOrderId = #{record.payOrderId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
TransactionId = #{record.transactionId,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=TINYINT},
HandleCount = #{record.handleCount,jdbcType=TINYINT},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.IapReceipt" >
update t_iap_receipt
<set >
<if test="mchId != null" >
MchId = #{mchId,jdbcType=VARCHAR},
</if>
<if test="transactionId != null" >
TransactionId = #{transactionId,jdbcType=VARCHAR},
</if>
<if test="status != null" >
Status = #{status,jdbcType=TINYINT},
</if>
<if test="handleCount != null" >
HandleCount = #{handleCount,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="receiptData != null" >
ReceiptData = #{receiptData,jdbcType=LONGVARCHAR},
</if>
</set>
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="org.xxpay.dal.dao.model.IapReceipt" >
update t_iap_receipt
set MchId = #{mchId,jdbcType=VARCHAR},
TransactionId = #{transactionId,jdbcType=VARCHAR},
Status = #{status,jdbcType=TINYINT},
HandleCount = #{handleCount,jdbcType=TINYINT},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
ReceiptData = #{receiptData,jdbcType=LONGVARCHAR}
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.IapReceipt" >
update t_iap_receipt
set MchId = #{mchId,jdbcType=VARCHAR},
TransactionId = #{transactionId,jdbcType=VARCHAR},
Status = #{status,jdbcType=TINYINT},
HandleCount = #{handleCount,jdbcType=TINYINT},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
<?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="org.xxpay.dal.dao.mapper.MchInfoMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.MchInfo" >
<id column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="Name" property="name" jdbcType="VARCHAR" />
<result column="Type" property="type" jdbcType="VARCHAR" />
<result column="ReqKey" property="reqKey" jdbcType="VARCHAR" />
<result column="ResKey" property="resKey" jdbcType="VARCHAR" />
<result column="State" property="state" jdbcType="TINYINT" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
MchId, Name, Type, ReqKey, ResKey, State, CreateTime, UpdateTime
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.MchInfoExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_mch_info
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from t_mch_info
where MchId = #{mchId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from t_mch_info
where MchId = #{mchId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.MchInfoExample" >
delete from t_mch_info
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.MchInfo" >
insert into t_mch_info (MchId, Name, Type,
ReqKey, ResKey, State,
CreateTime, UpdateTime)
values (#{mchId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{reqKey,jdbcType=VARCHAR}, #{resKey,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.MchInfo" >
insert into t_mch_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="mchId != null" >
MchId,
</if>
<if test="name != null" >
Name,
</if>
<if test="type != null" >
Type,
</if>
<if test="reqKey != null" >
ReqKey,
</if>
<if test="resKey != null" >
ResKey,
</if>
<if test="state != null" >
State,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null" >
#{type,jdbcType=VARCHAR},
</if>
<if test="reqKey != null" >
#{reqKey,jdbcType=VARCHAR},
</if>
<if test="resKey != null" >
#{resKey,jdbcType=VARCHAR},
</if>
<if test="state != null" >
#{state,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.MchInfoExample" resultType="java.lang.Integer" >
select count(*) from t_mch_info
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_mch_info
<set >
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.name != null" >
Name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null" >
Type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.reqKey != null" >
ReqKey = #{record.reqKey,jdbcType=VARCHAR},
</if>
<if test="record.resKey != null" >
ResKey = #{record.resKey,jdbcType=VARCHAR},
</if>
<if test="record.state != null" >
State = #{record.state,jdbcType=TINYINT},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_mch_info
set MchId = #{record.mchId,jdbcType=VARCHAR},
Name = #{record.name,jdbcType=VARCHAR},
Type = #{record.type,jdbcType=VARCHAR},
ReqKey = #{record.reqKey,jdbcType=VARCHAR},
ResKey = #{record.resKey,jdbcType=VARCHAR},
State = #{record.state,jdbcType=TINYINT},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.MchInfo" >
update t_mch_info
<set >
<if test="name != null" >
Name = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null" >
Type = #{type,jdbcType=VARCHAR},
</if>
<if test="reqKey != null" >
ReqKey = #{reqKey,jdbcType=VARCHAR},
</if>
<if test="resKey != null" >
ResKey = #{resKey,jdbcType=VARCHAR},
</if>
<if test="state != null" >
State = #{state,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where MchId = #{mchId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.MchInfo" >
update t_mch_info
set Name = #{name,jdbcType=VARCHAR},
Type = #{type,jdbcType=VARCHAR},
ReqKey = #{reqKey,jdbcType=VARCHAR},
ResKey = #{resKey,jdbcType=VARCHAR},
State = #{state,jdbcType=TINYINT},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where MchId = #{mchId,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
<?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="org.xxpay.dal.dao.mapper.PayChannelMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.PayChannel" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="ChannelId" property="channelId" jdbcType="VARCHAR" />
<result column="ChannelName" property="channelName" jdbcType="VARCHAR" />
<result column="ChannelMchId" property="channelMchId" jdbcType="VARCHAR" />
<result column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="State" property="state" jdbcType="TINYINT" />
<result column="Param" property="param" jdbcType="VARCHAR" />
<result column="Remark" property="remark" jdbcType="VARCHAR" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, ChannelId, ChannelName, ChannelMchId, MchId, State, Param, Remark, CreateTime,
UpdateTime
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.PayChannelExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_pay_channel
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from t_pay_channel
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from t_pay_channel
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.PayChannelExample" >
delete from t_pay_channel
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.PayChannel" >
insert into t_pay_channel (id, ChannelId, ChannelName,
ChannelMchId, MchId, State,
Param, Remark, CreateTime,
UpdateTime)
values (#{id,jdbcType=INTEGER}, #{channelId,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR},
#{channelMchId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT},
#{param,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.PayChannel" >
insert into t_pay_channel
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="channelId != null" >
ChannelId,
</if>
<if test="channelName != null" >
ChannelName,
</if>
<if test="channelMchId != null" >
ChannelMchId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="state != null" >
State,
</if>
<if test="param != null" >
Param,
</if>
<if test="remark != null" >
Remark,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="channelId != null" >
#{channelId,jdbcType=VARCHAR},
</if>
<if test="channelName != null" >
#{channelName,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
#{channelMchId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="state != null" >
#{state,jdbcType=TINYINT},
</if>
<if test="param != null" >
#{param,jdbcType=VARCHAR},
</if>
<if test="remark != null" >
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.PayChannelExample" resultType="java.lang.Integer" >
select count(*) from t_pay_channel
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_pay_channel
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.channelId != null" >
ChannelId = #{record.channelId,jdbcType=VARCHAR},
</if>
<if test="record.channelName != null" >
ChannelName = #{record.channelName,jdbcType=VARCHAR},
</if>
<if test="record.channelMchId != null" >
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
</if>
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.state != null" >
State = #{record.state,jdbcType=TINYINT},
</if>
<if test="record.param != null" >
Param = #{record.param,jdbcType=VARCHAR},
</if>
<if test="record.remark != null" >
Remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_pay_channel
set id = #{record.id,jdbcType=INTEGER},
ChannelId = #{record.channelId,jdbcType=VARCHAR},
ChannelName = #{record.channelName,jdbcType=VARCHAR},
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
State = #{record.state,jdbcType=TINYINT},
Param = #{record.param,jdbcType=VARCHAR},
Remark = #{record.remark,jdbcType=VARCHAR},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.PayChannel" >
update t_pay_channel
<set >
<if test="channelId != null" >
ChannelId = #{channelId,jdbcType=VARCHAR},
</if>
<if test="channelName != null" >
ChannelName = #{channelName,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
MchId = #{mchId,jdbcType=VARCHAR},
</if>
<if test="state != null" >
State = #{state,jdbcType=TINYINT},
</if>
<if test="param != null" >
Param = #{param,jdbcType=VARCHAR},
</if>
<if test="remark != null" >
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.PayChannel" >
update t_pay_channel
set ChannelId = #{channelId,jdbcType=VARCHAR},
ChannelName = #{channelName,jdbcType=VARCHAR},
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
MchId = #{mchId,jdbcType=VARCHAR},
State = #{state,jdbcType=TINYINT},
Param = #{param,jdbcType=VARCHAR},
Remark = #{remark,jdbcType=VARCHAR},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
<?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="org.xxpay.dal.dao.mapper.PayOrderMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.PayOrder" >
<id column="PayOrderId" property="payOrderId" jdbcType="VARCHAR" />
<result column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="MchOrderNo" property="mchOrderNo" jdbcType="VARCHAR" />
<result column="ChannelId" property="channelId" jdbcType="VARCHAR" />
<result column="Amount" property="amount" jdbcType="BIGINT" />
<result column="Currency" property="currency" jdbcType="VARCHAR" />
<result column="Status" property="status" jdbcType="TINYINT" />
<result column="ClientIp" property="clientIp" jdbcType="VARCHAR" />
<result column="Device" property="device" jdbcType="VARCHAR" />
<result column="Subject" property="subject" jdbcType="VARCHAR" />
<result column="Body" property="body" jdbcType="VARCHAR" />
<result column="Extra" property="extra" jdbcType="VARCHAR" />
<result column="ChannelMchId" property="channelMchId" jdbcType="VARCHAR" />
<result column="ChannelOrderNo" property="channelOrderNo" jdbcType="VARCHAR" />
<result column="ErrCode" property="errCode" jdbcType="VARCHAR" />
<result column="ErrMsg" property="errMsg" jdbcType="VARCHAR" />
<result column="Param1" property="param1" jdbcType="VARCHAR" />
<result column="Param2" property="param2" jdbcType="VARCHAR" />
<result column="NotifyUrl" property="notifyUrl" jdbcType="VARCHAR" />
<result column="NotifyCount" property="notifyCount" jdbcType="TINYINT" />
<result column="LastNotifyTime" property="lastNotifyTime" jdbcType="BIGINT" />
<result column="ExpireTime" property="expireTime" jdbcType="BIGINT" />
<result column="PaySuccTime" property="paySuccTime" jdbcType="BIGINT" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
PayOrderId, MchId, MchOrderNo, ChannelId, Amount, Currency, Status, ClientIp, Device,
Subject, Body, Extra, ChannelMchId, ChannelOrderNo, ErrCode, ErrMsg, Param1, Param2,
NotifyUrl, NotifyCount, LastNotifyTime, ExpireTime, PaySuccTime, CreateTime, UpdateTime
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.PayOrderExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_pay_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from t_pay_order
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from t_pay_order
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.PayOrderExample" >
delete from t_pay_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.PayOrder" >
insert into t_pay_order (PayOrderId, MchId, MchOrderNo,
ChannelId, Amount, Currency,
Status, ClientIp, Device,
Subject, Body, Extra,
ChannelMchId, ChannelOrderNo, ErrCode,
ErrMsg, Param1, Param2,
NotifyUrl, NotifyCount, LastNotifyTime,
ExpireTime, PaySuccTime, CreateTime,
UpdateTime)
values (#{payOrderId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{mchOrderNo,jdbcType=VARCHAR},
#{channelId,jdbcType=VARCHAR}, #{amount,jdbcType=BIGINT}, #{currency,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT}, #{clientIp,jdbcType=VARCHAR}, #{device,jdbcType=VARCHAR},
#{subject,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR}, #{extra,jdbcType=VARCHAR},
#{channelMchId,jdbcType=VARCHAR}, #{channelOrderNo,jdbcType=VARCHAR}, #{errCode,jdbcType=VARCHAR},
#{errMsg,jdbcType=VARCHAR}, #{param1,jdbcType=VARCHAR}, #{param2,jdbcType=VARCHAR},
#{notifyUrl,jdbcType=VARCHAR}, #{notifyCount,jdbcType=TINYINT}, #{lastNotifyTime,jdbcType=BIGINT},
#{expireTime,jdbcType=BIGINT}, #{paySuccTime,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.PayOrder" >
insert into t_pay_order
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="payOrderId != null" >
PayOrderId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="mchOrderNo != null" >
MchOrderNo,
</if>
<if test="channelId != null" >
ChannelId,
</if>
<if test="amount != null" >
Amount,
</if>
<if test="currency != null" >
Currency,
</if>
<if test="status != null" >
Status,
</if>
<if test="clientIp != null" >
ClientIp,
</if>
<if test="device != null" >
Device,
</if>
<if test="subject != null" >
Subject,
</if>
<if test="body != null" >
Body,
</if>
<if test="extra != null" >
Extra,
</if>
<if test="channelMchId != null" >
ChannelMchId,
</if>
<if test="channelOrderNo != null" >
ChannelOrderNo,
</if>
<if test="errCode != null" >
ErrCode,
</if>
<if test="errMsg != null" >
ErrMsg,
</if>
<if test="param1 != null" >
Param1,
</if>
<if test="param2 != null" >
Param2,
</if>
<if test="notifyUrl != null" >
NotifyUrl,
</if>
<if test="notifyCount != null" >
NotifyCount,
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime,
</if>
<if test="expireTime != null" >
ExpireTime,
</if>
<if test="paySuccTime != null" >
PaySuccTime,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="payOrderId != null" >
#{payOrderId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
#{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="channelId != null" >
#{channelId,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
#{amount,jdbcType=BIGINT},
</if>
<if test="currency != null" >
#{currency,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="clientIp != null" >
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="device != null" >
#{device,jdbcType=VARCHAR},
</if>
<if test="subject != null" >
#{subject,jdbcType=VARCHAR},
</if>
<if test="body != null" >
#{body,jdbcType=VARCHAR},
</if>
<if test="extra != null" >
#{extra,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
#{channelMchId,jdbcType=VARCHAR},
</if>
<if test="channelOrderNo != null" >
#{channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="errCode != null" >
#{errCode,jdbcType=VARCHAR},
</if>
<if test="errMsg != null" >
#{errMsg,jdbcType=VARCHAR},
</if>
<if test="param1 != null" >
#{param1,jdbcType=VARCHAR},
</if>
<if test="param2 != null" >
#{param2,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
#{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
#{notifyCount,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
#{lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="expireTime != null" >
#{expireTime,jdbcType=BIGINT},
</if>
<if test="paySuccTime != null" >
#{paySuccTime,jdbcType=BIGINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.PayOrderExample" resultType="java.lang.Integer" >
select count(*) from t_pay_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_pay_order
<set >
<if test="record.payOrderId != null" >
PayOrderId = #{record.payOrderId,jdbcType=VARCHAR},
</if>
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.mchOrderNo != null" >
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="record.channelId != null" >
ChannelId = #{record.channelId,jdbcType=VARCHAR},
</if>
<if test="record.amount != null" >
Amount = #{record.amount,jdbcType=BIGINT},
</if>
<if test="record.currency != null" >
Currency = #{record.currency,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
Status = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.clientIp != null" >
ClientIp = #{record.clientIp,jdbcType=VARCHAR},
</if>
<if test="record.device != null" >
Device = #{record.device,jdbcType=VARCHAR},
</if>
<if test="record.subject != null" >
Subject = #{record.subject,jdbcType=VARCHAR},
</if>
<if test="record.body != null" >
Body = #{record.body,jdbcType=VARCHAR},
</if>
<if test="record.extra != null" >
Extra = #{record.extra,jdbcType=VARCHAR},
</if>
<if test="record.channelMchId != null" >
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
</if>
<if test="record.channelOrderNo != null" >
ChannelOrderNo = #{record.channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="record.errCode != null" >
ErrCode = #{record.errCode,jdbcType=VARCHAR},
</if>
<if test="record.errMsg != null" >
ErrMsg = #{record.errMsg,jdbcType=VARCHAR},
</if>
<if test="record.param1 != null" >
Param1 = #{record.param1,jdbcType=VARCHAR},
</if>
<if test="record.param2 != null" >
Param2 = #{record.param2,jdbcType=VARCHAR},
</if>
<if test="record.notifyUrl != null" >
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
</if>
<if test="record.notifyCount != null" >
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
</if>
<if test="record.lastNotifyTime != null" >
LastNotifyTime = #{record.lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="record.expireTime != null" >
ExpireTime = #{record.expireTime,jdbcType=BIGINT},
</if>
<if test="record.paySuccTime != null" >
PaySuccTime = #{record.paySuccTime,jdbcType=BIGINT},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_pay_order
set PayOrderId = #{record.payOrderId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
ChannelId = #{record.channelId,jdbcType=VARCHAR},
Amount = #{record.amount,jdbcType=BIGINT},
Currency = #{record.currency,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=TINYINT},
ClientIp = #{record.clientIp,jdbcType=VARCHAR},
Device = #{record.device,jdbcType=VARCHAR},
Subject = #{record.subject,jdbcType=VARCHAR},
Body = #{record.body,jdbcType=VARCHAR},
Extra = #{record.extra,jdbcType=VARCHAR},
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
ChannelOrderNo = #{record.channelOrderNo,jdbcType=VARCHAR},
ErrCode = #{record.errCode,jdbcType=VARCHAR},
ErrMsg = #{record.errMsg,jdbcType=VARCHAR},
Param1 = #{record.param1,jdbcType=VARCHAR},
Param2 = #{record.param2,jdbcType=VARCHAR},
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
LastNotifyTime = #{record.lastNotifyTime,jdbcType=BIGINT},
ExpireTime = #{record.expireTime,jdbcType=BIGINT},
PaySuccTime = #{record.paySuccTime,jdbcType=BIGINT},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.PayOrder" >
update t_pay_order
<set >
<if test="mchId != null" >
MchId = #{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="channelId != null" >
ChannelId = #{channelId,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
Amount = #{amount,jdbcType=BIGINT},
</if>
<if test="currency != null" >
Currency = #{currency,jdbcType=VARCHAR},
</if>
<if test="status != null" >
Status = #{status,jdbcType=TINYINT},
</if>
<if test="clientIp != null" >
ClientIp = #{clientIp,jdbcType=VARCHAR},
</if>
<if test="device != null" >
Device = #{device,jdbcType=VARCHAR},
</if>
<if test="subject != null" >
Subject = #{subject,jdbcType=VARCHAR},
</if>
<if test="body != null" >
Body = #{body,jdbcType=VARCHAR},
</if>
<if test="extra != null" >
Extra = #{extra,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
</if>
<if test="channelOrderNo != null" >
ChannelOrderNo = #{channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="errCode != null" >
ErrCode = #{errCode,jdbcType=VARCHAR},
</if>
<if test="errMsg != null" >
ErrMsg = #{errMsg,jdbcType=VARCHAR},
</if>
<if test="param1 != null" >
Param1 = #{param1,jdbcType=VARCHAR},
</if>
<if test="param2 != null" >
Param2 = #{param2,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
NotifyCount = #{notifyCount,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime = #{lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="expireTime != null" >
ExpireTime = #{expireTime,jdbcType=BIGINT},
</if>
<if test="paySuccTime != null" >
PaySuccTime = #{paySuccTime,jdbcType=BIGINT},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.PayOrder" >
update t_pay_order
set MchId = #{mchId,jdbcType=VARCHAR},
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
ChannelId = #{channelId,jdbcType=VARCHAR},
Amount = #{amount,jdbcType=BIGINT},
Currency = #{currency,jdbcType=VARCHAR},
Status = #{status,jdbcType=TINYINT},
ClientIp = #{clientIp,jdbcType=VARCHAR},
Device = #{device,jdbcType=VARCHAR},
Subject = #{subject,jdbcType=VARCHAR},
Body = #{body,jdbcType=VARCHAR},
Extra = #{extra,jdbcType=VARCHAR},
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
ChannelOrderNo = #{channelOrderNo,jdbcType=VARCHAR},
ErrCode = #{errCode,jdbcType=VARCHAR},
ErrMsg = #{errMsg,jdbcType=VARCHAR},
Param1 = #{param1,jdbcType=VARCHAR},
Param2 = #{param2,jdbcType=VARCHAR},
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{notifyCount,jdbcType=TINYINT},
LastNotifyTime = #{lastNotifyTime,jdbcType=BIGINT},
ExpireTime = #{expireTime,jdbcType=BIGINT},
PaySuccTime = #{paySuccTime,jdbcType=BIGINT},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where PayOrderId = #{payOrderId,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
<?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="org.xxpay.dal.dao.mapper.TransOrderMapper" >
<resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.TransOrder" >
<id column="TransOrderId" property="transOrderId" jdbcType="VARCHAR" />
<result column="MchId" property="mchId" jdbcType="VARCHAR" />
<result column="MchOrderNo" property="mchOrderNo" jdbcType="VARCHAR" />
<result column="ChannelId" property="channelId" jdbcType="VARCHAR" />
<result column="Amount" property="amount" jdbcType="BIGINT" />
<result column="Currency" property="currency" jdbcType="VARCHAR" />
<result column="Status" property="status" jdbcType="TINYINT" />
<result column="ClientIp" property="clientIp" jdbcType="VARCHAR" />
<result column="Device" property="device" jdbcType="VARCHAR" />
<result column="RemarkInfo" property="remarkInfo" jdbcType="VARCHAR" />
<result column="OpenId" property="openId" jdbcType="VARCHAR" />
<result column="CheckName" property="checkName" jdbcType="TINYINT" />
<result column="UserName" property="userName" jdbcType="VARCHAR" />
<result column="Extra" property="extra" jdbcType="VARCHAR" />
<result column="ChannelMchId" property="channelMchId" jdbcType="VARCHAR" />
<result column="ChannelOrderNo" property="channelOrderNo" jdbcType="VARCHAR" />
<result column="ErrCode" property="errCode" jdbcType="VARCHAR" />
<result column="ErrMsg" property="errMsg" jdbcType="VARCHAR" />
<result column="Param1" property="param1" jdbcType="VARCHAR" />
<result column="Param2" property="param2" jdbcType="VARCHAR" />
<result column="NotifyUrl" property="notifyUrl" jdbcType="VARCHAR" />
<result column="NotifyCount" property="notifyCount" jdbcType="TINYINT" />
<result column="LastNotifyTime" property="lastNotifyTime" jdbcType="BIGINT" />
<result column="ExpireTime" property="expireTime" jdbcType="BIGINT" />
<result column="TransSuccTime" property="transSuccTime" jdbcType="BIGINT" />
<result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
TransOrderId, MchId, MchOrderNo, ChannelId, Amount, Currency, Status, ClientIp, Device,
RemarkInfo, OpenId, CheckName, UserName, Extra, ChannelMchId, ChannelOrderNo, ErrCode,
ErrMsg, Param1, Param2, NotifyUrl, NotifyCount, LastNotifyTime, ExpireTime, TransSuccTime,
CreateTime, UpdateTime
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.TransOrderExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from t_trans_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<if test="limit != null" >
<if test="offset != null" >
limit ${offset}, ${limit}
</if>
<if test="offset == null" >
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from t_trans_order
where TransOrderId = #{transOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from t_trans_order
where TransOrderId = #{transOrderId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.TransOrderExample" >
delete from t_trans_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.xxpay.dal.dao.model.TransOrder" >
insert into t_trans_order (TransOrderId, MchId, MchOrderNo,
ChannelId, Amount, Currency,
Status, ClientIp, Device,
RemarkInfo, OpenId, CheckName,
UserName, Extra, ChannelMchId,
ChannelOrderNo, ErrCode, ErrMsg,
Param1, Param2, NotifyUrl,
NotifyCount, LastNotifyTime, ExpireTime,
TransSuccTime, CreateTime, UpdateTime
)
values (#{transOrderId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{mchOrderNo,jdbcType=VARCHAR},
#{channelId,jdbcType=VARCHAR}, #{amount,jdbcType=BIGINT}, #{currency,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT}, #{clientIp,jdbcType=VARCHAR}, #{device,jdbcType=VARCHAR},
#{remarkInfo,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{checkName,jdbcType=TINYINT},
#{userName,jdbcType=VARCHAR}, #{extra,jdbcType=VARCHAR}, #{channelMchId,jdbcType=VARCHAR},
#{channelOrderNo,jdbcType=VARCHAR}, #{errCode,jdbcType=VARCHAR}, #{errMsg,jdbcType=VARCHAR},
#{param1,jdbcType=VARCHAR}, #{param2,jdbcType=VARCHAR}, #{notifyUrl,jdbcType=VARCHAR},
#{notifyCount,jdbcType=TINYINT}, #{lastNotifyTime,jdbcType=BIGINT}, #{expireTime,jdbcType=BIGINT},
#{transSuccTime,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.TransOrder" >
insert into t_trans_order
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="transOrderId != null" >
TransOrderId,
</if>
<if test="mchId != null" >
MchId,
</if>
<if test="mchOrderNo != null" >
MchOrderNo,
</if>
<if test="channelId != null" >
ChannelId,
</if>
<if test="amount != null" >
Amount,
</if>
<if test="currency != null" >
Currency,
</if>
<if test="status != null" >
Status,
</if>
<if test="clientIp != null" >
ClientIp,
</if>
<if test="device != null" >
Device,
</if>
<if test="remarkInfo != null" >
RemarkInfo,
</if>
<if test="openId != null" >
OpenId,
</if>
<if test="checkName != null" >
CheckName,
</if>
<if test="userName != null" >
UserName,
</if>
<if test="extra != null" >
Extra,
</if>
<if test="channelMchId != null" >
ChannelMchId,
</if>
<if test="channelOrderNo != null" >
ChannelOrderNo,
</if>
<if test="errCode != null" >
ErrCode,
</if>
<if test="errMsg != null" >
ErrMsg,
</if>
<if test="param1 != null" >
Param1,
</if>
<if test="param2 != null" >
Param2,
</if>
<if test="notifyUrl != null" >
NotifyUrl,
</if>
<if test="notifyCount != null" >
NotifyCount,
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime,
</if>
<if test="expireTime != null" >
ExpireTime,
</if>
<if test="transSuccTime != null" >
TransSuccTime,
</if>
<if test="createTime != null" >
CreateTime,
</if>
<if test="updateTime != null" >
UpdateTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="transOrderId != null" >
#{transOrderId,jdbcType=VARCHAR},
</if>
<if test="mchId != null" >
#{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
#{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="channelId != null" >
#{channelId,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
#{amount,jdbcType=BIGINT},
</if>
<if test="currency != null" >
#{currency,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="clientIp != null" >
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="device != null" >
#{device,jdbcType=VARCHAR},
</if>
<if test="remarkInfo != null" >
#{remarkInfo,jdbcType=VARCHAR},
</if>
<if test="openId != null" >
#{openId,jdbcType=VARCHAR},
</if>
<if test="checkName != null" >
#{checkName,jdbcType=TINYINT},
</if>
<if test="userName != null" >
#{userName,jdbcType=VARCHAR},
</if>
<if test="extra != null" >
#{extra,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
#{channelMchId,jdbcType=VARCHAR},
</if>
<if test="channelOrderNo != null" >
#{channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="errCode != null" >
#{errCode,jdbcType=VARCHAR},
</if>
<if test="errMsg != null" >
#{errMsg,jdbcType=VARCHAR},
</if>
<if test="param1 != null" >
#{param1,jdbcType=VARCHAR},
</if>
<if test="param2 != null" >
#{param2,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
#{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
#{notifyCount,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
#{lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="expireTime != null" >
#{expireTime,jdbcType=BIGINT},
</if>
<if test="transSuccTime != null" >
#{transSuccTime,jdbcType=BIGINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.xxpay.dal.dao.model.TransOrderExample" resultType="java.lang.Integer" >
select count(*) from t_trans_order
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update t_trans_order
<set >
<if test="record.transOrderId != null" >
TransOrderId = #{record.transOrderId,jdbcType=VARCHAR},
</if>
<if test="record.mchId != null" >
MchId = #{record.mchId,jdbcType=VARCHAR},
</if>
<if test="record.mchOrderNo != null" >
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="record.channelId != null" >
ChannelId = #{record.channelId,jdbcType=VARCHAR},
</if>
<if test="record.amount != null" >
Amount = #{record.amount,jdbcType=BIGINT},
</if>
<if test="record.currency != null" >
Currency = #{record.currency,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
Status = #{record.status,jdbcType=TINYINT},
</if>
<if test="record.clientIp != null" >
ClientIp = #{record.clientIp,jdbcType=VARCHAR},
</if>
<if test="record.device != null" >
Device = #{record.device,jdbcType=VARCHAR},
</if>
<if test="record.remarkInfo != null" >
RemarkInfo = #{record.remarkInfo,jdbcType=VARCHAR},
</if>
<if test="record.openId != null" >
OpenId = #{record.openId,jdbcType=VARCHAR},
</if>
<if test="record.checkName != null" >
CheckName = #{record.checkName,jdbcType=TINYINT},
</if>
<if test="record.userName != null" >
UserName = #{record.userName,jdbcType=VARCHAR},
</if>
<if test="record.extra != null" >
Extra = #{record.extra,jdbcType=VARCHAR},
</if>
<if test="record.channelMchId != null" >
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
</if>
<if test="record.channelOrderNo != null" >
ChannelOrderNo = #{record.channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="record.errCode != null" >
ErrCode = #{record.errCode,jdbcType=VARCHAR},
</if>
<if test="record.errMsg != null" >
ErrMsg = #{record.errMsg,jdbcType=VARCHAR},
</if>
<if test="record.param1 != null" >
Param1 = #{record.param1,jdbcType=VARCHAR},
</if>
<if test="record.param2 != null" >
Param2 = #{record.param2,jdbcType=VARCHAR},
</if>
<if test="record.notifyUrl != null" >
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
</if>
<if test="record.notifyCount != null" >
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
</if>
<if test="record.lastNotifyTime != null" >
LastNotifyTime = #{record.lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="record.expireTime != null" >
ExpireTime = #{record.expireTime,jdbcType=BIGINT},
</if>
<if test="record.transSuccTime != null" >
TransSuccTime = #{record.transSuccTime,jdbcType=BIGINT},
</if>
<if test="record.createTime != null" >
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null" >
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update t_trans_order
set TransOrderId = #{record.transOrderId,jdbcType=VARCHAR},
MchId = #{record.mchId,jdbcType=VARCHAR},
MchOrderNo = #{record.mchOrderNo,jdbcType=VARCHAR},
ChannelId = #{record.channelId,jdbcType=VARCHAR},
Amount = #{record.amount,jdbcType=BIGINT},
Currency = #{record.currency,jdbcType=VARCHAR},
Status = #{record.status,jdbcType=TINYINT},
ClientIp = #{record.clientIp,jdbcType=VARCHAR},
Device = #{record.device,jdbcType=VARCHAR},
RemarkInfo = #{record.remarkInfo,jdbcType=VARCHAR},
OpenId = #{record.openId,jdbcType=VARCHAR},
CheckName = #{record.checkName,jdbcType=TINYINT},
UserName = #{record.userName,jdbcType=VARCHAR},
Extra = #{record.extra,jdbcType=VARCHAR},
ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
ChannelOrderNo = #{record.channelOrderNo,jdbcType=VARCHAR},
ErrCode = #{record.errCode,jdbcType=VARCHAR},
ErrMsg = #{record.errMsg,jdbcType=VARCHAR},
Param1 = #{record.param1,jdbcType=VARCHAR},
Param2 = #{record.param2,jdbcType=VARCHAR},
NotifyUrl = #{record.notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{record.notifyCount,jdbcType=TINYINT},
LastNotifyTime = #{record.lastNotifyTime,jdbcType=BIGINT},
ExpireTime = #{record.expireTime,jdbcType=BIGINT},
TransSuccTime = #{record.transSuccTime,jdbcType=BIGINT},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.TransOrder" >
update t_trans_order
<set >
<if test="mchId != null" >
MchId = #{mchId,jdbcType=VARCHAR},
</if>
<if test="mchOrderNo != null" >
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
</if>
<if test="channelId != null" >
ChannelId = #{channelId,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
Amount = #{amount,jdbcType=BIGINT},
</if>
<if test="currency != null" >
Currency = #{currency,jdbcType=VARCHAR},
</if>
<if test="status != null" >
Status = #{status,jdbcType=TINYINT},
</if>
<if test="clientIp != null" >
ClientIp = #{clientIp,jdbcType=VARCHAR},
</if>
<if test="device != null" >
Device = #{device,jdbcType=VARCHAR},
</if>
<if test="remarkInfo != null" >
RemarkInfo = #{remarkInfo,jdbcType=VARCHAR},
</if>
<if test="openId != null" >
OpenId = #{openId,jdbcType=VARCHAR},
</if>
<if test="checkName != null" >
CheckName = #{checkName,jdbcType=TINYINT},
</if>
<if test="userName != null" >
UserName = #{userName,jdbcType=VARCHAR},
</if>
<if test="extra != null" >
Extra = #{extra,jdbcType=VARCHAR},
</if>
<if test="channelMchId != null" >
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
</if>
<if test="channelOrderNo != null" >
ChannelOrderNo = #{channelOrderNo,jdbcType=VARCHAR},
</if>
<if test="errCode != null" >
ErrCode = #{errCode,jdbcType=VARCHAR},
</if>
<if test="errMsg != null" >
ErrMsg = #{errMsg,jdbcType=VARCHAR},
</if>
<if test="param1 != null" >
Param1 = #{param1,jdbcType=VARCHAR},
</if>
<if test="param2 != null" >
Param2 = #{param2,jdbcType=VARCHAR},
</if>
<if test="notifyUrl != null" >
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
</if>
<if test="notifyCount != null" >
NotifyCount = #{notifyCount,jdbcType=TINYINT},
</if>
<if test="lastNotifyTime != null" >
LastNotifyTime = #{lastNotifyTime,jdbcType=BIGINT},
</if>
<if test="expireTime != null" >
ExpireTime = #{expireTime,jdbcType=BIGINT},
</if>
<if test="transSuccTime != null" >
TransSuccTime = #{transSuccTime,jdbcType=BIGINT},
</if>
<if test="createTime != null" >
CreateTime = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where TransOrderId = #{transOrderId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.TransOrder" >
update t_trans_order
set MchId = #{mchId,jdbcType=VARCHAR},
MchOrderNo = #{mchOrderNo,jdbcType=VARCHAR},
ChannelId = #{channelId,jdbcType=VARCHAR},
Amount = #{amount,jdbcType=BIGINT},
Currency = #{currency,jdbcType=VARCHAR},
Status = #{status,jdbcType=TINYINT},
ClientIp = #{clientIp,jdbcType=VARCHAR},
Device = #{device,jdbcType=VARCHAR},
RemarkInfo = #{remarkInfo,jdbcType=VARCHAR},
OpenId = #{openId,jdbcType=VARCHAR},
CheckName = #{checkName,jdbcType=TINYINT},
UserName = #{userName,jdbcType=VARCHAR},
Extra = #{extra,jdbcType=VARCHAR},
ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
ChannelOrderNo = #{channelOrderNo,jdbcType=VARCHAR},
ErrCode = #{errCode,jdbcType=VARCHAR},
ErrMsg = #{errMsg,jdbcType=VARCHAR},
Param1 = #{param1,jdbcType=VARCHAR},
Param2 = #{param2,jdbcType=VARCHAR},
NotifyUrl = #{notifyUrl,jdbcType=VARCHAR},
NotifyCount = #{notifyCount,jdbcType=TINYINT},
LastNotifyTime = #{lastNotifyTime,jdbcType=BIGINT},
ExpireTime = #{expireTime,jdbcType=BIGINT},
TransSuccTime = #{transSuccTime,jdbcType=BIGINT},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where TransOrderId = #{transOrderId,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.xxpay</groupId>
<artifactId>xxpay-mgr</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>xxpay-mgr</name>
<description>xxpay-master</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<mysql.connector.java.version>5.1.34</mysql.connector.java.version>
<mybatis.version>3.4.1</mybatis.version>
<mybatis.spring.version>1.3.0</mybatis.spring.version>
<mybatis.generator.version>1.3.2</mybatis.generator.version>
<fastjson.version>1.2.7</fastjson.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.xxpay</groupId>
<artifactId>xxpay-dal</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- Spring Boot Freemarker 依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!-- Spring Boot Web 依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Boot Test 依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.3.6.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>xxpay-mgr</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource> <!-- 配置需要被替换的资源文件路径 -->
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
<assembly>
<id>bin</id>
<!-- 最终打包成一个用于发布的zip文件 -->
<formats>
<format>tar.gz</format>
</formats>
<!-- Adds dependencies to zip package under lib directory -->
<dependencySets>
<dependencySet>
<!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
<fileSets>
<!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
<!-- 把项目的配置文件,打包进zip文件的config目录 -->
<!--<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>classes</outputDirectory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
</fileSet>-->
<!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
<fileSet>
<directory>${project.build.scriptSourceDirectory}</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>*.*</include>
</includes>
</fileSet>
<!-- 把项目的脚本文件(除了启动脚本文件),打包进zip文件的script目录 -->
<fileSet>
<directory>${project.build.scriptSourceDirectory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>startup.*</include>
</includes>
</fileSet>
<!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
<!--<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>-->
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>classes</outputDirectory>
<includes>
<include>**/*.class</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
package org.xxpay;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
/**
* Created by fyunli on 16/4/1.
*/
@SpringBootApplication
public class XxPayMgrApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(XxPayMgrApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
application.listeners();
return application.sources(applicationClass);
}
private static Class<XxPayMgrApplication> applicationClass = XxPayMgrApplication.class;
}
\ No newline at end of file
package org.xxpay.mgr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.xxpay.common.util.DateUtil;
import org.xxpay.common.util.MyLog;
import org.xxpay.dal.dao.model.MchInfo;
import org.xxpay.dal.dao.plugin.PageModel;
import org.xxpay.mgr.service.MchInfoService;
import java.util.List;
@Controller
@RequestMapping("/mch_info")
public class MchInfoController {
private final static MyLog _log = MyLog.getLog(MchInfoController.class);
@Autowired
private MchInfoService mchInfoService;
@RequestMapping("/list.html")
public String listInput(ModelMap model) {
return "mch_info/list";
}
@RequestMapping("/edit.html")
public String editInput(String mchId, ModelMap model) {
MchInfo item = null;
if(StringUtils.isNotBlank(mchId)) {
item = mchInfoService.selectMchInfo(mchId);
}
if(item == null) item = new MchInfo();
model.put("item", item);
return "mch_info/edit";
}
@RequestMapping("/list")
@ResponseBody
public String list(@ModelAttribute MchInfo mchInfo, Integer pageIndex, Integer pageSize) {
PageModel pageModel = new PageModel();
int count = mchInfoService.count(mchInfo);
if(count <= 0) return JSON.toJSONString(pageModel);
List<MchInfo> mchInfoList = mchInfoService.getMchInfoList((pageIndex-1)*pageSize, pageSize, mchInfo);
if(!CollectionUtils.isEmpty(mchInfoList)) {
JSONArray array = new JSONArray();
for(MchInfo mi : mchInfoList) {
JSONObject object = (JSONObject) JSONObject.toJSON(mi);
object.put("createTime", DateUtil.date2Str(mi.getCreateTime()));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public String save(@RequestParam String params) {
JSONObject po = JSONObject.parseObject(params);
MchInfo mchInfo = new MchInfo();
String mchId = po.getString("mchId");
mchInfo.setName(po.getString("name"));
mchInfo.setType(po.getString("type"));
mchInfo.setState((byte) ("on".equalsIgnoreCase(po.getString("state")) ? 1 : 0));
mchInfo.setReqKey(po.getString("reqKey"));
mchInfo.setResKey(po.getString("resKey"));
int result;
if(StringUtils.isBlank(mchId)) {
// 添加
result = mchInfoService.addMchInfo(mchInfo);
}else {
// 修改
mchInfo.setMchId(mchId);
result = mchInfoService.updateMchInfo(mchInfo);
}
_log.info("保存商户记录,返回:{}", result);
return result+"";
}
@RequestMapping("/view.html")
public String viewInput(String mchId, ModelMap model) {
MchInfo item = null;
if(StringUtils.isNotBlank(mchId)) {
item = mchInfoService.selectMchInfo(mchId);
}
if(item == null) item = new MchInfo();
model.put("item", item);
return "mch_info/view";
}
}
\ No newline at end of file
package org.xxpay.mgr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.xxpay.common.util.DateUtil;
import org.xxpay.common.util.MyLog;
import org.xxpay.dal.dao.model.PayChannel;
import org.xxpay.dal.dao.plugin.PageModel;
import org.xxpay.mgr.service.PayChannelService;
import java.util.List;
@Controller
@RequestMapping("/pay_channel")
public class PayChannelController {
private final static MyLog _log = MyLog.getLog(PayChannelController.class);
@Autowired
private PayChannelService payChannelService;
@RequestMapping("/list.html")
public String listInput(ModelMap model) {
return "pay_channel/list";
}
@RequestMapping("/edit.html")
public String editInput(String id, ModelMap model) {
PayChannel item = null;
if(StringUtils.isNotBlank(id) && NumberUtils.isNumber(id)) {
item = payChannelService.selectPayChannel(Integer.parseInt(id));
}
if(item == null) item = new PayChannel();
model.put("item", item);
return "pay_channel/edit";
}
@RequestMapping("/list")
@ResponseBody
public String list(@ModelAttribute PayChannel payChannel, Integer pageIndex, Integer pageSize) {
PageModel pageModel = new PageModel();
int count = payChannelService.count(payChannel);
if(count <= 0) return JSON.toJSONString(pageModel);
List<PayChannel> payChannelList = payChannelService.getPayChannelList((pageIndex-1)*pageSize, pageSize, payChannel);
if(!CollectionUtils.isEmpty(payChannelList)) {
JSONArray array = new JSONArray();
for(PayChannel pc : payChannelList) {
JSONObject object = (JSONObject) JSONObject.toJSON(pc);
object.put("createTime", DateUtil.date2Str(pc.getCreateTime()));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public String save(@RequestParam String params) {
JSONObject po = JSONObject.parseObject(params);
PayChannel payChannel = new PayChannel();
Integer id = po.getInteger("id");
payChannel.setChannelId(po.getString("channelId"));
payChannel.setMchId(po.getString("mchId"));
payChannel.setChannelName(po.getString("channelName"));
payChannel.setChannelMchId(po.getString("channelMchId"));
payChannel.setState((byte) ("on".equalsIgnoreCase(po.getString("state")) ? 1 : 0));
payChannel.setParam(po.getString("param"));
payChannel.setRemark(po.getString("remark"));
int result;
if(id == null) {
// 添加
result = payChannelService.addPayChannel(payChannel);
}else {
// 修改
payChannel.setId(id);
result = payChannelService.updatePayChannel(payChannel);
}
_log.info("保存渠道记录,返回:{}", result);
return result+"";
}
@RequestMapping("/view.html")
public String viewInput(String id, ModelMap model) {
PayChannel item = null;
if(StringUtils.isNotBlank(id) && NumberUtils.isNumber(id)) {
item = payChannelService.selectPayChannel(Integer.parseInt(id));
}
if(item == null) item = new PayChannel();
model.put("item", item);
return "pay_channel/view";
}
}
\ No newline at end of file
package org.xxpay.mgr.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.xxpay.common.util.AmountUtil;
import org.xxpay.common.util.DateUtil;
import org.xxpay.common.util.MyLog;
import org.xxpay.dal.dao.model.PayOrder;
import org.xxpay.dal.dao.plugin.PageModel;
import org.xxpay.mgr.service.PayOrderService;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/pay_order")
public class PayOrderController {
private final static MyLog _log = MyLog.getLog(PayOrderController.class);
@Autowired
private PayOrderService payOrderService;
@RequestMapping("/list.html")
public String listInput(ModelMap model) {
return "pay_order/list";
}
@RequestMapping("/list")
@ResponseBody
public String list(@ModelAttribute PayOrder payOrder, Integer pageIndex, Integer pageSize) {
PageModel pageModel = new PageModel();
int count = payOrderService.count(payOrder);
if(count <= 0) return JSON.toJSONString(pageModel);
List<PayOrder> payOrderList = payOrderService.getPayOrderList((pageIndex-1)*pageSize, pageSize, payOrder);
if(!CollectionUtils.isEmpty(payOrderList)) {
JSONArray array = new JSONArray();
for(PayOrder po : payOrderList) {
JSONObject object = (JSONObject) JSONObject.toJSON(po);
if(po.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(po.getCreateTime()));
if(po.getAmount() != null) object.put("amount", AmountUtil.convertCent2Dollar(po.getAmount()+""));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
@RequestMapping("/view.html")
public String viewInput(String payOrderId, ModelMap model) {
PayOrder item = null;
if(StringUtils.isNotBlank(payOrderId)) {
item = payOrderService.selectPayOrder(payOrderId);
}
if(item == null) {
item = new PayOrder();
model.put("item", item);
return "pay_order/view";
}
JSONObject object = (JSONObject) JSON.toJSON(item);
if(item.getPaySuccTime() != null) object.put("paySuccTime", DateUtil.date2Str(new Date(item.getPaySuccTime())));
if(item.getLastNotifyTime() != null) object.put("lastNotifyTime", DateUtil.date2Str(new Date(item.getLastNotifyTime())));
if(item.getExpireTime() != null) object.put("expireTime", DateUtil.date2Str(new Date(item.getExpireTime())));
if(item.getAmount() != null) object.put("amount", AmountUtil.convertCent2Dollar(item.getAmount()+""));
model.put("item", object);
return "pay_order/view";
}
}
\ No newline at end of file
package org.xxpay.mgr.service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.xxpay.dal.dao.mapper.MchInfoMapper;
import org.xxpay.dal.dao.model.MchInfo;
import org.xxpay.dal.dao.model.MchInfoExample;
import java.util.List;
/**
* Created by dingzhiwei on 17/5/4.
*/
@Component
public class MchInfoService {
@Autowired
private MchInfoMapper mchInfoMapper;
public int addMchInfo(MchInfo mchInfo) {
MchInfoExample example = new MchInfoExample();
example.setOrderByClause("mchId DESC");
example.setOffset(0);
example.setLimit(1);
List<MchInfo> mchInfos = mchInfoMapper.selectByExample(example);
String mchId = "10000000";
if(!CollectionUtils.isEmpty(mchInfos)) {
mchId = String.valueOf(Integer.parseInt(mchInfos.get(0).getMchId()) + 1);
}
mchInfo.setMchId(mchId);
return mchInfoMapper.insertSelective(mchInfo);
}
public int updateMchInfo(MchInfo mchInfo) {
return mchInfoMapper.updateByPrimaryKeySelective(mchInfo);
}
public MchInfo selectMchInfo(String mchId) {
return mchInfoMapper.selectByPrimaryKey(mchId);
}
public List<MchInfo> getMchInfoList(int offset, int limit, MchInfo mchInfo) {
MchInfoExample example = new MchInfoExample();
example.setOrderByClause("createTime DESC");
example.setOffset(offset);
example.setLimit(limit);
MchInfoExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, mchInfo);
return mchInfoMapper.selectByExample(example);
}
public Integer count(MchInfo mchInfo) {
MchInfoExample example = new MchInfoExample();
MchInfoExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, mchInfo);
return mchInfoMapper.countByExample(example);
}
void setCriteria(MchInfoExample.Criteria criteria, MchInfo mchInfo) {
if(mchInfo != null) {
if(StringUtils.isNotBlank(mchInfo.getMchId())) criteria.andMchIdEqualTo(mchInfo.getMchId());
if(mchInfo.getType() != null && !"-99".equals(mchInfo.getType())) criteria.andTypeEqualTo(mchInfo.getType());
}
}
}
package org.xxpay.mgr.service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.xxpay.dal.dao.mapper.PayChannelMapper;
import org.xxpay.dal.dao.model.PayChannel;
import org.xxpay.dal.dao.model.PayChannelExample;
import java.util.List;
/**
* Created by dingzhiwei on 17/5/7.
*/
@Component
public class PayChannelService {
@Autowired
private PayChannelMapper payChannelMapper;
public int addPayChannel(PayChannel payChannel) {
return payChannelMapper.insertSelective(payChannel);
}
public int updatePayChannel(PayChannel payChannel) {
return payChannelMapper.updateByPrimaryKeySelective(payChannel);
}
public PayChannel selectPayChannel(String channelId, String mchId) {
PayChannelExample example = new PayChannelExample();
PayChannelExample.Criteria criteria = example.createCriteria();
criteria.andChannelIdEqualTo(channelId);
criteria.andMchIdEqualTo(mchId);
List<PayChannel> payChannelList = payChannelMapper.selectByExample(example);
if(CollectionUtils.isEmpty(payChannelList)) return null;
return payChannelList.get(0);
}
public PayChannel selectPayChannel(int id) {
return payChannelMapper.selectByPrimaryKey(id);
}
public List<PayChannel> getPayChannelList(int offset, int limit, PayChannel payChannel) {
PayChannelExample example = new PayChannelExample();
example.setOrderByClause("mchId ASC, channelId ASC, createTime DESC");
example.setOffset(offset);
example.setLimit(limit);
PayChannelExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, payChannel);
return payChannelMapper.selectByExample(example);
}
public Integer count(PayChannel payChannel) {
PayChannelExample example = new PayChannelExample();
PayChannelExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, payChannel);
return payChannelMapper.countByExample(example);
}
void setCriteria(PayChannelExample.Criteria criteria, PayChannel payChannel) {
if(payChannel != null) {
if(StringUtils.isNotBlank(payChannel.getMchId())) criteria.andMchIdEqualTo(payChannel.getMchId());
if(StringUtils.isNotBlank(payChannel.getChannelId())) criteria.andChannelIdEqualTo(payChannel.getChannelId());
}
}
}
package org.xxpay.mgr.service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xxpay.common.constant.PayConstant;
import org.xxpay.dal.dao.mapper.PayOrderMapper;
import org.xxpay.dal.dao.model.PayOrder;
import org.xxpay.dal.dao.model.PayOrderExample;
import java.util.List;
/**
* Created by dingzhiwei on 17/5/7.
*/
@Component
public class PayOrderService {
@Autowired
private PayOrderMapper payOrderMapper;
public PayOrder selectPayOrder(String payOrderId) {
return payOrderMapper.selectByPrimaryKey(payOrderId);
}
public List<PayOrder> getPayOrderList(int offset, int limit, PayOrder payOrder) {
PayOrderExample example = new PayOrderExample();
example.setOrderByClause("createTime DESC");
example.setOffset(offset);
example.setLimit(limit);
PayOrderExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, payOrder);
return payOrderMapper.selectByExample(example);
}
public Integer count(PayOrder payOrder) {
PayOrderExample example = new PayOrderExample();
PayOrderExample.Criteria criteria = example.createCriteria();
setCriteria(criteria, payOrder);
return payOrderMapper.countByExample(example);
}
void setCriteria(PayOrderExample.Criteria criteria, PayOrder payOrder) {
if(payOrder != null) {
if(StringUtils.isNotBlank(payOrder.getMchId())) criteria.andMchIdEqualTo(payOrder.getMchId());
if(StringUtils.isNotBlank(payOrder.getPayOrderId())) criteria.andPayOrderIdEqualTo(payOrder.getPayOrderId());
if(StringUtils.isNotBlank(payOrder.getMchOrderNo())) criteria.andMchOrderNoEqualTo(payOrder.getMchOrderNo());
if(StringUtils.isNotBlank(payOrder.getChannelOrderNo())) criteria.andChannelOrderNoEqualTo(payOrder.getChannelOrderNo());
if(payOrder.getStatus() != null && payOrder.getStatus() != -99) criteria.andStatusEqualTo(payOrder.getStatus());
}
}
}
server.port=8092
spring.freemarker.cache=false
spring.freemarker.charset=UTF-8
spring.freemarker.check-template-location=true
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=true
spring.freemarker.expose-session-attributes=true
spring.freemarker.request-context-attribute=request
spring.freemarker.suffix=.ftl
spring.freemarker.templateEncoding=UTF-8
spring.freemarker.templateLoaderPath=classpath:/templates/
# properties
application.message:Hello,Spring Boot
# \u5FAE\u4FE1\u516C\u4F17\u53F7
application.wx.app_id=wx077cb62e341f8a5c
application.wx.app_secret=e663ea068f3e4f952f143de1432a35c2
#\u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxpaydb?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=true
spring.datasource.username=xxpay
spring.datasource.password=xxpay
# \u4E0B\u9762\u4E3A\u8FDE\u63A5\u6C60\u7684\u8865\u5145\u8BBE\u7F6E\uFF0C\u5E94\u7528\u5230\u4E0A\u9762\u6240\u6709\u6570\u636E\u6E90\u4E2D# \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=20
# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
spring.datasource.maxWait=60000
# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
spring.datasource.timeBetweenEvictionRunsMillis=60000
# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
spring.datasource.minEvictableIdleTimeMillis=300000
spring.datasource.validationQuery=SELECT 1 FROM DUAL
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
# \u6253\u5F00PSCache\uFF0C\u5E76\u4E14\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F
spring.datasource.poolPreparedStatements=true
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
# \u914D\u7F6E\u76D1\u63A7\u7EDF\u8BA1\u62E6\u622A\u7684filters\uFF0C\u53BB\u6389\u540E\u76D1\u63A7\u754C\u9762sql\u65E0\u6CD5\u7EDF\u8BA1\uFF0C'wall'\u7528\u4E8E\u9632\u706B\u5899
spring.datasource.filters=stat,wall,log4j
# \u901A\u8FC7connectProperties\u5C5E\u6027\u6765\u6253\u5F00mergeSql\u529F\u80FD\uFF1B\u6162SQL\u8BB0\u5F55
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# \u5408\u5E76\u591A\u4E2ADruidDataSource\u7684\u76D1\u63A7\u6570\u636E
#spring.datasource.useGlobalDataSourceStat=true
### \u65E5\u5FD7
logging.file=./log/xxpay-mgr.log
spring.mvc.favicon.enabled = false
\ No newline at end of file
.beg-table-box {
position: relative;
height: 100%;
width: 100%;
max-width: 100%;
}
.beg-table-header {
position: absolute;
width: 100%;
}
.beg-table-header table {
width: 100%;
max-width: 100%;
}
.beg-table-header table thead tr th {
vertical-align: bottom;
border-bottom: 2px solid #DDDDDD;
padding: 7px 15px;
background-color: #f2f2f2;
}
.beg-table-body {
overflow: auto;
width: 100%;
max-height: 100%;
}
.beg-table {
width: 100%;
max-width: 100%;
height: 100%;
margin-bottom: 40px;
}
.beg-table thead {}
.beg-table thead tr {}
.beg-table thead tr th {
vertical-align: bottom;
border-bottom: 2px solid #DDDDDD;
padding: 7px 15px;
background-color: #f2f2f2;
}
.beg-table tbody {}
.beg-table tbody tr {}
.beg-table tbody tr td {
padding: 7px 15px;
border-bottom: 1px solid #DDDDDD;
vertical-align: top;
}
.beg-table-bordered {
border: 1px solid #DDDDDD;
}
.beg-table-bordered td,
.beg-table-bordered th {
border: 1px solid #DDDDDD;
}
.beg-table-striped tbody tr:nth-child(even),
.beg-table-hovered tbody tr:hover {
background-color: #f6f6f6;
}
/*page*/
.beg-table-box .beg-table-paged {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
line-height: 40px;
background-color: #f2f2f2;
}
.beg-table-box .beg-table-paged .layui-laypage {
margin: 3px 5px 0 5px;
}
.beg-table-box .beg-table-paged .layui-laypage a {
/*margin: 0;*/
}
\ No newline at end of file
Supports Markdown
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