作者 shenhailong

充值水费 返回二维码

... ... @@ -24,6 +24,36 @@
</properties>
<dependencies>
<!--水电缴费支付需要包-->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
... ...
... ... @@ -66,4 +66,5 @@ public class PayOrderController {
}
return mgs==1? new ResultJson("200","订单信息移出成功"):new ResultJson("500","订单信息删除失败");
}
}
... ...
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.PayResponseMapper;
import com.sunyo.energy.location.model.PayResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;
@Controller
@RequestMapping("/payCode")
public class PayRseponeController {
@Autowired
private PayResponseMapper payResponseMapperl;
/**
* 接受字段
* @param POSID 商户柜台代码
* @param BRANCHID 分行代码
* @param ORDERID 定单号
* @param PAYMENT 付款金额
* @param CURCODE 币种
* @param REMARK1 备注一
* @param REMARK2 备注二
* @param ACC_TYPE 账户类型
* @param SUCCESS 成功标志
* @param TYPE 接口类型
* @param REFERER Referer信息
* @param CLIENTIP 客户端IP
* @param ACCDATE 系统记账日期
* @param USRMSG 支付账户信息
* @param USRINFO 客户加密信息
* @param PAYTYPE 支付方式
* @param SIGN 数字签名
*/
@RequestMapping(value = "/payRseponse")
@ApiOperation(value = "支付回执是否成功")
@ResponseBody
public ResultJson payCodeRsepone(@RequestParam(value = "POSID", required = false) String POSID,
@RequestParam(value = "BRANCHID", required = false) String BRANCHID,
@RequestParam(value = "ORDERID", required = false) String ORDERID,
@RequestParam(value = "PAYMENT", required = false) String PAYMENT,
@RequestParam(value = "CURCODE", required = false) String CURCODE,
@RequestParam(value = "REMARK1", required = false) String REMARK1,
@RequestParam(value = "REMARK2", required = false) String REMARK2,
@RequestParam(value = "ACC_TYPE", required = false) String ACC_TYPE,
@RequestParam(value = "SUCCESS", required = false) String SUCCESS,
@RequestParam(value = "TYPE", required = false) String TYPE,
@RequestParam(value = "REFERER", required = false) String REFERER,
@RequestParam(value = "CLIENTIP", required = false) String CLIENTIP,
@RequestParam(value = "ACCDATE", required = false) String ACCDATE,
@RequestParam(value = "USRMSG", required = false) String USRMSG,
@RequestParam(value = "USRINFO", required = false) String USRINFO,
@RequestParam(value = "PAYTYPE", required = false) String PAYTYPE,
@RequestParam(value = "SIGN", required = false) String SIGN){
PayResponse payResponse = new PayResponse();
payResponse.setId(UUID.randomUUID().toString());
payResponse.setPosid(POSID);
payResponse.setBranchid(BRANCHID);
payResponse.setOrderid(ORDERID);
payResponse.setPayment(new BigDecimal(PAYMENT));
payResponse.setCurcode(CURCODE);
payResponse.setRemark1(REMARK1);
payResponse.setRemark2(REMARK2);
payResponse.setAccType(ACC_TYPE);
payResponse.setSuccess(SUCCESS);
payResponse.setType(TYPE);
payResponse.setReferer(REFERER);
payResponse.setClientip(CLIENTIP);
payResponse.setAccdate(new Date());
payResponse.setUsrmsg(USRMSG);
payResponse.setUsrinfo(USRINFO);
payResponse.setPaytype(PAYTYPE);
payResponse.setSign(SIGN);
int msg = 0;
int i = payResponseMapperl.insertSelective(payResponse);
if (i>0){
msg=1;
}
return i==1? new ResultJson("200","支付回执信息接受成功"):new ResultJson("500","支付回执信息接受失败");
}
}
... ...
... ... @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.util.List;
@Api(description = "用户支付管理")
... ... @@ -46,4 +47,15 @@ public class UserPayController {
return waterMeterService.payWater(payFees, wmId, userId, realName);
}
@ApiOperation(value = "请求返回二维码")
@PostMapping("/qrCode")
public ResultJson qrCode(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId,
@RequestParam(value = "userId", required = false) String userId,
@RequestParam(value = "realName", required = false) String realName) throws UnsupportedEncodingException {
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName);
return resultJson;
}
}
... ...
package com.sunyo.energy.location.dao;
import com.sunyo.energy.location.model.PayResponse;
public interface PayResponseMapper {
int deleteByPrimaryKey(String id);
int insert(PayResponse record);
int insertSelective(PayResponse record);
PayResponse selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(PayResponse record);
int updateByPrimaryKey(PayResponse record);
}
\ No newline at end of file
... ...
package com.sunyo.energy.location.demopay;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class HttpClientUtil {
public static String httpReader(String url, String code){
System.out.println("GetPage:"+url);
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
String result = null;
try {
client.executeMethod(method);
int status = method.getStatusCode();
if (status == HttpStatus.SC_OK) {
result = method.getResponseBodyAsString();
} else {
System.out.println("Method failed: " + method.getStatusLine());
}
} catch (HttpException e) {
// �����������쳣��������Э�鲻�Ի��߷��ص�����������
System.out.println("Please check your provided http address!");
e.printStackTrace();
} catch (IOException e) {
// ���������쳣
System.out.println("���������쳣��");
e.printStackTrace();
} finally{
// �ͷ�����
if(method!=null)method.releaseConnection();
method = null;
client = null;
}
return result;
}
public static String httpGet(String url,String code) {
System.out.println("GetPage:"+url);
String content = null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");
GetMethod method = new GetMethod(url);
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode="+statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if(method!=null)method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap, String code) {
System.out.println("GetPage:"+url);
String content = null;
if (url == null || url.trim().length() == 0 || paramMap == null
|| paramMap.isEmpty())
return null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");//
//��������
//httpClient.getHostConfiguration().setProxy("128.128.176.74", 808);
PostMethod method = new PostMethod(url);
Iterator it = paramMap.keySet().iterator();
while (it.hasNext()) {
String key = it.next() + "";
Object o = paramMap.get(key);
if (o != null && o instanceof String) {
method.addParameter(new NameValuePair(key, o.toString()));
}
if (o != null && o instanceof String[]) {
String[] s = (String[]) o;
if (s != null)
for (int i = 0; i < s.length; i++) {
method.addParameter(new NameValuePair(key, s[i]));
}
}
}
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode="+statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if(method!=null)method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap) {
//���룺UTF-8
return HttpClientUtil.httpPost(url, paramMap, "UTF-8");
}
}
... ...
package com.sunyo.energy.location.demopay;
import java.io.*;
import java.security.*;
public class MD5
{
public static String md5Str(String str)
{
if (str == null)return "";
return md5Str(str, 0);
}
/**
* ������ϢժҪ��
* @param data ����ժҪ�����ݡ�
* @param offset ����ƫ�Ƶ�ַ��
* @param length ���ݳ��ȡ�
* @return ժҪ�����(16�ֽ�)
*/
public static String md5Str(String str, int offset)
{
try
{
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] b = str.getBytes("UTF8");
md5.update(b, offset, b.length);
return byteArrayToHexString(md5.digest());
}
catch (NoSuchAlgorithmException ex)
{
ex.printStackTrace();
return null;
}
catch (UnsupportedEncodingException ex)
{
ex.printStackTrace();
return null;
}
}
/**
*
* @param b byte[]
* @return String
*/
public static String byteArrayToHexString(byte[] b)
{
String result = "";
for (int i = 0; i < b.length; i++)
{
result += byteToHexString(b[i]);
}
return result;
}
private static String[] hexDigits =
{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b",
"c", "d", "e", "f"};
/**
* ���ֽ�ת��Ϊ��Ӧ��16��������
* @param b byte
* @return String
*/
public static String byteToHexString(byte b)
{
int n = b;
if (n < 0)
{
n = 256 + n;
}
int d1 = n / 16;
int d2 = n % 16;
return hexDigits[d1] + hexDigits[d2];
}
public static void main(String[] args)
{
System.out.println(byteToHexString((byte)-99));
String str =
"eeeeeeeeeeeeeewrw213123122222222222222222222222213123213213213erwer";
String ened = MD5.md5Str(str);
System.out.println(ened.length());
System.out.println(ened);
}
}
... ...
package com.sunyo.energy.location.demopay;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.sunyo.energy.location.model.WaterMeter;
import net.sf.json.JSONObject;
import net.sf.json.util.JSONUtils;
import springfox.documentation.spring.web.json.Json;
public class QrDemo {
public static String orUrl(String orderId, String payMent) throws UnsupportedEncodingException {
String bankURL="https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain";
String MERCHANTID = "105001453995827";
String POSID = "031575220";
String BRANCHID = "410000000";
// String ORDERID = "1050014539958271238454321";
// String PAYMENT= "0.01";
String CURCODE="01";
String TXCODE = "530550";
String REMARK1 = "";
String REMARK2 = "";
String RETURNTYPE="3";
String TIMEOUT = "";
String PUB32TR2= "8578d1cd9340dba556126a71020111";
StringBuffer tmp = new StringBuffer(); //ÑéÇ©×Ö¶Î
tmp.append("MERCHANTID=");
tmp.append(MERCHANTID);
tmp.append("&POSID=");
tmp.append(POSID);
tmp.append("&BRANCHID=");
tmp.append(BRANCHID);
tmp.append("&ORDERID=");
tmp.append(orderId);
tmp.append("&PAYMENT=");
tmp.append(payMent);
tmp.append("&CURCODE=");
tmp.append(CURCODE);
tmp.append("&TXCODE=");
tmp.append(TXCODE);
tmp.append("&REMARK1=");
tmp.append(REMARK1);
tmp.append("&REMARK2=");
tmp.append(REMARK2);
tmp.append("&RETURNTYPE=");
tmp.append(RETURNTYPE);
tmp.append("&TIMEOUT=");
tmp.append(TIMEOUT);
tmp.append("&PUB=");
tmp.append(PUB32TR2);
Map map = new HashMap();
map.put("CCB_IBSVersion","V6"); //±ØÊäÏî
map.put("MERCHANTID",MERCHANTID);
map.put("BRANCHID",BRANCHID);
map.put("POSID",POSID);
map.put("ORDERID",orderId);
map.put("PAYMENT",payMent);
map.put("CURCODE",CURCODE);
map.put("TXCODE",TXCODE);
map.put("REMARK1",REMARK1);
map.put("REMARK2",REMARK2);
map.put("RETURNTYPE",RETURNTYPE);
map.put("TIMEOUT",TIMEOUT);
map.put("MAC",MD5.md5Str(tmp.toString()));
String ret = HttpClientUtil.httpPost(bankURL, map);
Gson gson = new Gson();
QrURLDemo qrurl = (QrURLDemo) gson.fromJson(ret, QrURLDemo.class);
String rets = HttpClientUtil.httpGet(qrurl.getPAYURL(), "UTF-8");
JSONObject jsonObject = JSONObject.fromObject(rets);
String qrurl1 = URLDecoder.decode(jsonObject.get("QRURL").toString(), "UTF-8");
return qrurl1;
}
}
... ...
package com.sunyo.energy.location.demopay;
public class QrORURLDemo {
private String SUCCESS;
private String ORYURL;
public String getSUCCESS() {
return SUCCESS;
}
public void setSUCCESS(String success) {
SUCCESS = success;
}
public String getORYURL() {
return ORYURL;
}
public void setORYURL(String ORYURL) {
this.ORYURL = ORYURL;
}
}
... ...
package com.sunyo.energy.location.demopay;
public class QrURLDemo {
private String SUCCESS;
private String PAYURL;
public String getSUCCESS() {
return SUCCESS;
}
public void setSUCCESS(String success) {
SUCCESS = success;
}
public String getPAYURL() {
return PAYURL;
}
public void setPAYURL(String payurl) {
PAYURL = payurl;
}
}
... ...
package com.sunyo.energy.location.model;
import java.math.BigDecimal;
import java.util.Date;
public class PayResponse {
private String id;
private String posid;
private String branchid;
private String orderid;
private BigDecimal payment;
private String curcode;
private String remark1;
private String remark2;
private String accType;
private String success;
private String type;
private String referer;
private String clientip;
private Date accdate;
private String usrmsg;
private String usrinfo;
private String paytype;
private String sign;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getPosid() {
return posid;
}
public void setPosid(String posid) {
this.posid = posid == null ? null : posid.trim();
}
public String getBranchid() {
return branchid;
}
public void setBranchid(String branchid) {
this.branchid = branchid == null ? null : branchid.trim();
}
public String getOrderid() {
return orderid;
}
public void setOrderid(String orderid) {
this.orderid = orderid == null ? null : orderid.trim();
}
public BigDecimal getPayment() {
return payment;
}
public void setPayment(BigDecimal payment) {
this.payment = payment;
}
public String getCurcode() {
return curcode;
}
public void setCurcode(String curcode) {
this.curcode = curcode == null ? null : curcode.trim();
}
public String getRemark1() {
return remark1;
}
public void setRemark1(String remark1) {
this.remark1 = remark1 == null ? null : remark1.trim();
}
public String getRemark2() {
return remark2;
}
public void setRemark2(String remark2) {
this.remark2 = remark2 == null ? null : remark2.trim();
}
public String getAccType() {
return accType;
}
public void setAccType(String accType) {
this.accType = accType == null ? null : accType.trim();
}
public String getSuccess() {
return success;
}
public void setSuccess(String success) {
this.success = success == null ? null : success.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getReferer() {
return referer;
}
public void setReferer(String referer) {
this.referer = referer == null ? null : referer.trim();
}
public String getClientip() {
return clientip;
}
public void setClientip(String clientip) {
this.clientip = clientip == null ? null : clientip.trim();
}
public Date getAccdate() {
return accdate;
}
public void setAccdate(Date accdate) {
this.accdate = accdate;
}
public String getUsrmsg() {
return usrmsg;
}
public void setUsrmsg(String usrmsg) {
this.usrmsg = usrmsg == null ? null : usrmsg.trim();
}
public String getUsrinfo() {
return usrinfo;
}
public void setUsrinfo(String usrinfo) {
this.usrinfo = usrinfo == null ? null : usrinfo.trim();
}
public String getPaytype() {
return paytype;
}
public void setPaytype(String paytype) {
this.paytype = paytype == null ? null : paytype.trim();
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign == null ? null : sign.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,8 @@ package com.sunyo.energy.location.service;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.WaterMeter;
import java.io.UnsupportedEncodingException;
public interface WaterMeterService {
int realTime();
... ... @@ -14,5 +16,8 @@ public interface WaterMeterService {
ResultJson waterMeterAll(String wmId);
// 请求返回二维码
ResultJson qrCode(String payFees, String wmId, String userId, String realName) throws UnsupportedEncodingException;
}
... ...
... ... @@ -8,6 +8,7 @@ import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.LocationMapper;
import com.sunyo.energy.location.dao.PayRecordsMapper;
import com.sunyo.energy.location.dao.WaterMeterMapper;
import com.sunyo.energy.location.demopay.QrDemo;
import com.sunyo.energy.location.model.PayRecords;
import com.sunyo.energy.location.model.WaterMeter;
import com.sunyo.energy.location.service.WaterMeterService;
... ... @@ -20,6 +21,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
... ... @@ -168,6 +170,27 @@ public class WaterMeterServiceImp implements WaterMeterService {
}
}
// 请求返回二维码
@Override
public ResultJson qrCode(String payFees, String wmId, String userId, String realName) throws UnsupportedEncodingException {
ResultJson<Object> resultJson = new ResultJson<>();
// 成功生成水费订单
PayRecords payRecords = payRecords(payFees, wmId, userId, realName);
// 请求返回二维码lujing
String s = QrDemo.orUrl(payRecords.getOrdernumber(), payFees);
int i = payRecordsMapper.insertSelective(payRecords);
if(i>0){
resultJson.setCode("200");
}
if (!"".equals(s)){
resultJson.setData(s);
}
return resultJson;
}
/**
* 总水量 换算
* @param payFees
... ... @@ -208,7 +231,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
PayRecords payRecords = new PayRecords();
payRecords.setOrdernumber(AllUtils.getOrderIdByTime());
payRecords.setPayfees(Long.valueOf(payFees));
payRecords.setPaystatus(true);
payRecords.setPaystatus(false);
payRecords.setPaytype(false);
payRecords.setReamke1("0");
payRecords.setPayuserid(Integer.valueOf(userId));
... ...
... ... @@ -46,14 +46,14 @@ public class AllUtils {
// 订单号生成 时间加随机数
public static String getOrderIdByTime() {
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
String newDate=sdf.format(new Date());
// 商户码
String merchantId ="105001453995827";
String result="";
Random random=new Random();
for(int i=0;i<3;i++){
result+=random.nextInt(10);
}
return newDate+result;
return merchantId+result;
}
... ...
${AnsiColor.YELLOW}
#####################################################
# #
# _oo0oo_ #
# o8888888o #
# 88" . "88 #
# (| -_- |) #
# 0\ = /0 #
# ___/`---'\___ #
# .' \\| |# '. #
# / \\||| : |||# \ #
# / _||||| -:- |||||- \ #
# | | \\\ - #/ | | #
# | \_| ''\---/'' |_/ | #
# \ .-\__ '-' ___/-. / #
# ___'. .' /--.--\ `. .'___ #
# ."" '< `.___\_<|>_/___.' >' "". #
# | | : `- \`.;`\ _ /`;.`/ - ` : | | #
# \ \ `_. \_ __\ /__ _/ .-` / / #
# =====`-.____`.___ \_____/___.-`___.-'===== #
# `=---=' #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# #
# 佛祖保佑 永不宕机 永无Bug #
# #
#####################################################
.::::.
.::::::::.
... ... @@ -43,7 +18,6 @@ ${AnsiColor.YELLOW}
...::: ::::::::::::' ``::.
```` ':. ':::::::::' ::::..
'.:::::' ':'````..
不存在的 你看我美吗
==================================================
Application Info:${application.title}
... ...
... ... @@ -45,6 +45,6 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="pay_records" domainObjectName="PayRecords" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="true"></table>
<table tableName="pay_response" domainObjectName="PayResponse" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="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="com.sunyo.energy.location.dao.PayResponseMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayResponse" >
<id column="ID" property="id" jdbcType="VARCHAR" />
<result column="POSID" property="posid" jdbcType="VARCHAR" />
<result column="BRANCHID" property="branchid" jdbcType="VARCHAR" />
<result column="ORDERID" property="orderid" jdbcType="VARCHAR" />
<result column="PAYMENT" property="payment" jdbcType="DECIMAL" />
<result column="CURCODE" property="curcode" jdbcType="VARCHAR" />
<result column="REMARK1" property="remark1" jdbcType="VARCHAR" />
<result column="REMARK2" property="remark2" jdbcType="VARCHAR" />
<result column="ACC_TYPE" property="accType" jdbcType="VARCHAR" />
<result column="SUCCESS" property="success" jdbcType="VARCHAR" />
<result column="TYPE" property="type" jdbcType="VARCHAR" />
<result column="REFERER" property="referer" jdbcType="VARCHAR" />
<result column="CLIENTIP" property="clientip" jdbcType="VARCHAR" />
<result column="ACCDATE" property="accdate" jdbcType="TIMESTAMP" />
<result column="USRMSG" property="usrmsg" jdbcType="VARCHAR" />
<result column="USRINFO" property="usrinfo" jdbcType="VARCHAR" />
<result column="PAYTYPE" property="paytype" jdbcType="VARCHAR" />
<result column="SIGN" property="sign" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, POSID, BRANCHID, ORDERID, PAYMENT, CURCODE, REMARK1, REMARK2, ACC_TYPE, SUCCESS,
TYPE, REFERER, CLIENTIP, ACCDATE, USRMSG, USRINFO, PAYTYPE, SIGN
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from pay_response
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from pay_response
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayResponse" >
insert into pay_response (ID, POSID, BRANCHID,
ORDERID, PAYMENT, CURCODE,
REMARK1, REMARK2, ACC_TYPE,
SUCCESS, TYPE, REFERER,
CLIENTIP, ACCDATE, USRMSG,
USRINFO, PAYTYPE, SIGN
)
values (#{id,jdbcType=VARCHAR}, #{posid,jdbcType=VARCHAR}, #{branchid,jdbcType=VARCHAR},
#{orderid,jdbcType=VARCHAR}, #{payment,jdbcType=DECIMAL}, #{curcode,jdbcType=VARCHAR},
#{remark1,jdbcType=VARCHAR}, #{remark2,jdbcType=VARCHAR}, #{accType,jdbcType=VARCHAR},
#{success,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{referer,jdbcType=VARCHAR},
#{clientip,jdbcType=VARCHAR}, #{accdate,jdbcType=TIMESTAMP}, #{usrmsg,jdbcType=VARCHAR},
#{usrinfo,jdbcType=VARCHAR}, #{paytype,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayResponse" >
insert into pay_response
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="posid != null" >
POSID,
</if>
<if test="branchid != null" >
BRANCHID,
</if>
<if test="orderid != null" >
ORDERID,
</if>
<if test="payment != null" >
PAYMENT,
</if>
<if test="curcode != null" >
CURCODE,
</if>
<if test="remark1 != null" >
REMARK1,
</if>
<if test="remark2 != null" >
REMARK2,
</if>
<if test="accType != null" >
ACC_TYPE,
</if>
<if test="success != null" >
SUCCESS,
</if>
<if test="type != null" >
TYPE,
</if>
<if test="referer != null" >
REFERER,
</if>
<if test="clientip != null" >
CLIENTIP,
</if>
<if test="accdate != null" >
ACCDATE,
</if>
<if test="usrmsg != null" >
USRMSG,
</if>
<if test="usrinfo != null" >
USRINFO,
</if>
<if test="paytype != null" >
PAYTYPE,
</if>
<if test="sign != null" >
SIGN,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="posid != null" >
#{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null" >
#{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null" >
#{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null" >
#{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null" >
#{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null" >
#{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null" >
#{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null" >
#{accType,jdbcType=VARCHAR},
</if>
<if test="success != null" >
#{success,jdbcType=VARCHAR},
</if>
<if test="type != null" >
#{type,jdbcType=VARCHAR},
</if>
<if test="referer != null" >
#{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null" >
#{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null" >
#{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null" >
#{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null" >
#{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null" >
#{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null" >
#{sign,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayResponse" >
update pay_response
<set >
<if test="posid != null" >
POSID = #{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null" >
BRANCHID = #{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null" >
ORDERID = #{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null" >
PAYMENT = #{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null" >
CURCODE = #{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null" >
REMARK1 = #{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null" >
REMARK2 = #{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null" >
ACC_TYPE = #{accType,jdbcType=VARCHAR},
</if>
<if test="success != null" >
SUCCESS = #{success,jdbcType=VARCHAR},
</if>
<if test="type != null" >
TYPE = #{type,jdbcType=VARCHAR},
</if>
<if test="referer != null" >
REFERER = #{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null" >
CLIENTIP = #{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null" >
ACCDATE = #{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null" >
USRMSG = #{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null" >
USRINFO = #{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null" >
PAYTYPE = #{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null" >
SIGN = #{sign,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayResponse" >
update pay_response
set POSID = #{posid,jdbcType=VARCHAR},
BRANCHID = #{branchid,jdbcType=VARCHAR},
ORDERID = #{orderid,jdbcType=VARCHAR},
PAYMENT = #{payment,jdbcType=DECIMAL},
CURCODE = #{curcode,jdbcType=VARCHAR},
REMARK1 = #{remark1,jdbcType=VARCHAR},
REMARK2 = #{remark2,jdbcType=VARCHAR},
ACC_TYPE = #{accType,jdbcType=VARCHAR},
SUCCESS = #{success,jdbcType=VARCHAR},
TYPE = #{type,jdbcType=VARCHAR},
REFERER = #{referer,jdbcType=VARCHAR},
CLIENTIP = #{clientip,jdbcType=VARCHAR},
ACCDATE = #{accdate,jdbcType=TIMESTAMP},
USRMSG = #{usrmsg,jdbcType=VARCHAR},
USRINFO = #{usrinfo,jdbcType=VARCHAR},
PAYTYPE = #{paytype,jdbcType=VARCHAR},
SIGN = #{sign,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...
package com.sunyo.customer.order;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderApplicationTests {
@Test
public void contextLoads() {
}
}