parent
6b5c47bf52
commit
0993e8d32e
@ -0,0 +1,105 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.service.gas.BsGasOrderReceiptService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/gasOrderReceipt") |
||||
@Api(value = "加油订单业务") |
||||
public class BsGasOrderReceiptController { |
||||
private static Logger log = LoggerFactory.getLogger(BsGasOrderReceiptController.class); |
||||
@Resource |
||||
private BsGasOrderReceiptService gasOrderReceiptService; |
||||
|
||||
@RequestMapping(value="/success",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "开票成功") |
||||
public ResponseData success(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("applyNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
gasOrderReceiptService.success(body.getString("applyNo")); |
||||
|
||||
return ResponseMsgUtil.success("申请成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/fail",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "开票失败") |
||||
public ResponseData fail(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("applyNo")) |
||||
|| StringUtils.isBlank(body.getString("remark")) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
gasOrderReceiptService.fail(body.getString("applyNo"),body.getString("remark")); |
||||
|
||||
return ResponseMsgUtil.success("申请成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryReceiptList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询申请列表") |
||||
public ResponseData queryReceiptList(@RequestParam(name = "orderNo", required = false) String orderNo, |
||||
@RequestParam(name = "contactsPhone", required = false) String contactsPhone, |
||||
@RequestParam(name = "status", required = false) Integer status, |
||||
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
||||
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("orderNo", orderNo); |
||||
param.put("contactsPhone", contactsPhone); |
||||
param.put("status", status); |
||||
param.put("createTimeS", createTimeS); |
||||
param.put("createTimeE", createTimeE); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(gasOrderReceiptService.getList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,89 @@ |
||||
package com.bweb.controller.notify; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.channel.gas.newlink.NewLinkGasService; |
||||
import com.hfkj.channel.gas.newlink.NewLinkRequestService; |
||||
import com.hfkj.common.security.AESEncodeUtil; |
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsOrderRefund; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.service.order.BsOrderRefundService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
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.RequestMethod; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
/** |
||||
* @className: NewLinkNotify |
||||
* @author: HuRui |
||||
* @date: 2024/7/26 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value = "/newLinkNotify") |
||||
@Api(value = "加油订单业务") |
||||
public class NewLinkNotify { |
||||
|
||||
@Resource |
||||
private NewLinkGasService newLinkGasService; |
||||
@Resource |
||||
private BsOrderRefundService orderRefundService; |
||||
@Resource |
||||
private BsGasOrderService gasOrderService; |
||||
|
||||
@RequestMapping(value="/merChange",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "商户变更") |
||||
public String merChange(@RequestBody JSONObject body) { |
||||
try { |
||||
System.out.println("================团油商户变更通知=================="); |
||||
System.out.println(body); |
||||
String bodyData = body.getString("data"); |
||||
// 解密参数
|
||||
JSONObject data = JSONObject.parseObject(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(bodyData), NewLinkRequestService.APP_SECRET)); |
||||
if ("001".equals(data.getString("type"))) { |
||||
// 油站更新
|
||||
newLinkGasService.merChange(data.getString("value")); |
||||
} |
||||
} catch (Exception e) { |
||||
System.out.println("变更异常:" + e.getMessage()); |
||||
} finally { |
||||
System.out.println("================团油商户变更通知=================="); |
||||
} |
||||
return "success"; |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value="/orderRefund",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "订单退款") |
||||
public String orderRefund(@RequestBody JSONObject body) { |
||||
try { |
||||
System.out.println("================团油交易退款通知=================="); |
||||
System.out.println(body); |
||||
String bodyData = body.getString("data"); |
||||
// 解密参数
|
||||
JSONObject data = JSONObject.parseObject(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(bodyData), NewLinkRequestService.APP_SECRET)); |
||||
if (data.getBoolean("refundResult").equals(true)) { |
||||
// 查询加油订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(data.getString("thirdOrderNo")); |
||||
if (gasOrder != null) { |
||||
// 退款
|
||||
orderRefundService.tradeOrderChildRefund(gasOrder.getChannelOrderNo(), false,1, data.getString("refundFailReason")); |
||||
} |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
System.out.println("变更异常:" + e.getMessage()); |
||||
} finally { |
||||
System.out.println("================团油交易退款通知=================="); |
||||
} |
||||
return "success"; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,124 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsUserReceipt; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.service.user.BsUserReceiptService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsUserReceiptController |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
@Controller |
||||
@RequestMapping(value = "/userReceipt") |
||||
@Api(value = "用户收据") |
||||
public class BsUserReceiptController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BsUserReceiptController.class); |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
@Resource |
||||
private BsUserReceiptService userReceiptService; |
||||
|
||||
@RequestMapping(value = "/editReceipt", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "编辑收据") |
||||
public ResponseData editReceipt(@RequestBody BsUserReceipt body) { |
||||
try { |
||||
UserSessionObject sessionObject = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (sessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getCompanyName()) |
||||
|| StringUtils.isBlank(body.getTaxNo()) |
||||
|| StringUtils.isBlank(body.getContactsPhone()) |
||||
|| StringUtils.isBlank(body.getEmail()) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
BsUserReceipt receipt = null; |
||||
if (body.getId() != null) { |
||||
// 查询数据
|
||||
receipt = userReceiptService.getDetail(body.getId()); |
||||
if (receipt == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的数据"); |
||||
} |
||||
} else { |
||||
receipt = new BsUserReceipt(); |
||||
receipt.setUserId(sessionObject.getUser().getId()); |
||||
receipt.setStatus(1); |
||||
} |
||||
receipt.setType(1); |
||||
receipt.setCompanyName(body.getCompanyName()); |
||||
receipt.setTaxNo(body.getTaxNo()); |
||||
receipt.setContactsPhone(body.getContactsPhone()); |
||||
receipt.setEmail(body.getEmail()); |
||||
userReceiptService.editData(receipt); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryDetail",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询详情") |
||||
public ResponseData queryDetail(@RequestParam(name = "id", required = true) Long id) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(userReceiptService.getDetail(id)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/queryUserReceiptList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询用户票据") |
||||
public ResponseData queryUserReceiptList(@RequestParam(name = "status", required = false) String status, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
UserSessionObject sessionObject = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (sessionObject == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("userId", sessionObject.getUser().getId()); |
||||
param.put("status", status); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(userReceiptService.getList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,57 @@ |
||||
package com.cweb.controller.order; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.gas.BsGasOrderReceiptService; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.service.user.BsUserReceiptService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/gasOrderReceipt") |
||||
@Api(value = "加油订单业务") |
||||
public class GasOrderReceiptController { |
||||
private static Logger log = LoggerFactory.getLogger(GasOrderReceiptController.class); |
||||
@Resource |
||||
private BsGasOrderReceiptService gasOrderReceiptService; |
||||
|
||||
@RequestMapping(value="/applyReceipt",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "申请收据") |
||||
public ResponseData applyReceipt(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null |
||||
|| body.getLong("userReceiptId") == null |
||||
|| body.getJSONArray("orderNo") == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
List<String> orderNoList = body.getJSONArray("orderNo") |
||||
.stream().map(Object::toString) |
||||
.collect(Collectors.toList()); |
||||
|
||||
gasOrderReceiptService.applyReceipt(body.getLong("userReceiptId"), orderNoList); |
||||
|
||||
return ResponseMsgUtil.success("申请成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,183 @@ |
||||
package com.hfkj.channel.gas.shell; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.HttpsUtils; |
||||
import com.hfkj.common.utils.MD5Util; |
||||
import com.hfkj.config.CommonSysConst; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* paylo系统 四川壳牌 |
||||
* @className: PayloService |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
@Component |
||||
public class ScShellPetroleumRequestService { |
||||
|
||||
private final static String REQ_URL = CommonSysConst.getSysConfig().getScShellReqUrl(); |
||||
private static final String PARTNER_ID = CommonSysConst.getSysConfig().getScShellPartnerId(); |
||||
private static final String PLAT_MERCHANT_KEY = CommonSysConst.getSysConfig().getScShellPlatMerchantKey(); |
||||
|
||||
/** |
||||
* 查询全量加油站 |
||||
* @param pageNum 当前页码 |
||||
* @param pageSize 每页数据量。最大值50 |
||||
* @return |
||||
*/ |
||||
public JSONObject ycShellPageQueryAllStation(Integer pageNum, Integer pageSize) throws Exception { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("pageNo", pageNum); |
||||
param.put("pageSize", pageSize); |
||||
return request(System.currentTimeMillis()+"","ycShellPageQueryAllStation", param); |
||||
} |
||||
|
||||
/** |
||||
* 查询单个油站全量信息 |
||||
* @param stationCode 油站编码 |
||||
* @return |
||||
*/ |
||||
public JSONObject ycShellStationQueryDetail(String stationCode) { |
||||
try { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("stationCode", stationCode); |
||||
return request(System.currentTimeMillis()+"","ycShellStationQueryDetail", param); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 【同步】油站付款 |
||||
* @param orderNo 订单号 |
||||
* @param stationCode 油站编码 |
||||
* @param finishTime 完成时间 |
||||
* @param oilPrice 加油金额 |
||||
* @param oilCode 油品编码 |
||||
* @param oilGun 油枪 |
||||
* @param settlementAmount 支付金额 |
||||
* @param channelFavourAmount 优惠金额 |
||||
* @return |
||||
*/ |
||||
public JSONObject syncYcShellPaymentNotify(String orderNo, |
||||
String stationCode, |
||||
Date finishTime, |
||||
BigDecimal oilPrice, |
||||
String oilCode, |
||||
String oilGun, |
||||
BigDecimal settlementAmount, |
||||
BigDecimal channelFavourAmount) throws Exception { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("stationCode", stationCode); |
||||
param.put("orderType", "OIL"); |
||||
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss")); |
||||
param.put("channelFavourAmount", channelFavourAmount); |
||||
|
||||
Map<String, Object> tradeOilOrder = new HashMap<>(); |
||||
tradeOilOrder.put("amount", oilPrice); |
||||
tradeOilOrder.put("code", oilCode); |
||||
tradeOilOrder.put("oilGun", oilGun); |
||||
tradeOilOrder.put("channelSettlementAmount", settlementAmount); |
||||
param.put("tradeOilOrder", JSONObject.toJSONString(tradeOilOrder)); |
||||
return request(orderNo, "syncYcShellPaymentNotify", param); |
||||
} |
||||
|
||||
/** |
||||
* 【同步】油站退款 |
||||
* @param finishTime 业务完成时间 |
||||
* @param tradeNo 交易流水号 |
||||
* @return |
||||
*/ |
||||
public JSONObject syncYcShellRefundNotify(Date finishTime,String tradeNo) throws Exception { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss")); |
||||
param.put("tradeNo", tradeNo); |
||||
// 请求接口
|
||||
return request(System.currentTimeMillis()+"" ,"syncYcShellRefundNotify", param); |
||||
} |
||||
|
||||
/** |
||||
* 接口请求 |
||||
* @param map |
||||
* @return |
||||
* @throws Exception |
||||
*/ |
||||
private JSONObject request(String logSerialNo, String service, Map<String,Object> map) throws Exception { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("merchantOrderNo", logSerialNo); |
||||
param.put("partnerId", PARTNER_ID); |
||||
param.put("service", service); |
||||
param.put("version", "1.0.0"); |
||||
param.put("signType", "MD5"); |
||||
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) { |
||||
param.put(entry.getKey(), entry.getValue()); |
||||
} |
||||
param.put("sign", MD5Util.encode(generateSignature(param, PLAT_MERCHANT_KEY).getBytes()).toLowerCase()); |
||||
|
||||
// 请求接口
|
||||
JSONObject object = HttpsUtils.doPost(REQ_URL, param); |
||||
if (object == null || !object.getString("status").equals("SUCCESS")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object == null?"请求失败":object.getString("message")); |
||||
} |
||||
return object; |
||||
} |
||||
|
||||
/** |
||||
* 生成签名 |
||||
* @param data 数据 |
||||
* @param key 秘钥app_secret |
||||
* @return 加密结果 |
||||
*/ |
||||
public static String generateSignature(final Map<String, Object> data, String key) { |
||||
Set<String> keySet = data.keySet(); |
||||
String[] keyArray = keySet.toArray(new String[keySet.size()]); |
||||
Arrays.sort(keyArray); |
||||
StringBuilder sb = new StringBuilder(); |
||||
for (String k : keyArray) { |
||||
if (data.get(k) != null) { |
||||
if (StringUtils.isBlank(sb.toString())) { |
||||
sb.append(k).append("=").append(data.get(k)); |
||||
} else { |
||||
sb.append("&").append(k).append("=").append(data.get(k)); |
||||
} |
||||
} |
||||
} |
||||
sb.append(key); |
||||
return sb.toString(); |
||||
} |
||||
|
||||
/** |
||||
* 生成参数 |
||||
* @param data 数据 |
||||
* @return 加密结果 |
||||
*/ |
||||
public static String generateParam(final Map<String, Object> data) { |
||||
Set<String> keySet = data.keySet(); |
||||
String[] keyArray = keySet.toArray(new String[keySet.size()]); |
||||
StringBuilder sb = new StringBuilder(); |
||||
for (String k : keyArray) { |
||||
if (data.get(k) != null) { |
||||
if (StringUtils.isBlank(sb.toString())) { |
||||
sb.append(k).append("=").append(data.get(k)); |
||||
} else { |
||||
sb.append("&").append(k).append("=").append(data.get(k)); |
||||
} |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,150 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsGasOrderReceipt; |
||||
import com.hfkj.entity.BsGasOrderReceiptExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsGasOrderReceiptMapper extends BsGasOrderReceiptMapperExt { |
||||
@SelectProvider(type=BsGasOrderReceiptSqlProvider.class, method="countByExample") |
||||
long countByExample(BsGasOrderReceiptExample example); |
||||
|
||||
@DeleteProvider(type=BsGasOrderReceiptSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsGasOrderReceiptExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_gas_order_receipt", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_gas_order_receipt (apply_no, user_receipt_id, ", |
||||
"company_name, tax_no, ", |
||||
"contacts_phone, email, ", |
||||
"order_no, order_child_no, ", |
||||
"oil_no, amount, `status`, ", |
||||
"fail_remark, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{applyNo,jdbcType=VARCHAR}, #{userReceiptId,jdbcType=BIGINT}, ", |
||||
"#{companyName,jdbcType=VARCHAR}, #{taxNo,jdbcType=VARCHAR}, ", |
||||
"#{contactsPhone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ", |
||||
"#{orderNo,jdbcType=VARCHAR}, #{orderChildNo,jdbcType=VARCHAR}, ", |
||||
"#{oilNo,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", |
||||
"#{failRemark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsGasOrderReceipt record); |
||||
|
||||
@InsertProvider(type=BsGasOrderReceiptSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsGasOrderReceipt record); |
||||
|
||||
@SelectProvider(type=BsGasOrderReceiptSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_receipt_id", property="userReceiptId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="fail_remark", property="failRemark", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsGasOrderReceipt> selectByExample(BsGasOrderReceiptExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, apply_no, user_receipt_id, company_name, tax_no, contacts_phone, email, ", |
||||
"order_no, order_child_no, oil_no, amount, `status`, fail_remark, create_time, ", |
||||
"update_time, ext_1, ext_2, ext_3", |
||||
"from bs_gas_order_receipt", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_receipt_id", property="userReceiptId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="fail_remark", property="failRemark", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsGasOrderReceipt selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsGasOrderReceipt record, @Param("example") BsGasOrderReceiptExample example); |
||||
|
||||
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsGasOrderReceipt record, @Param("example") BsGasOrderReceiptExample example); |
||||
|
||||
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsGasOrderReceipt record); |
||||
|
||||
@Update({ |
||||
"update bs_gas_order_receipt", |
||||
"set apply_no = #{applyNo,jdbcType=VARCHAR},", |
||||
"user_receipt_id = #{userReceiptId,jdbcType=BIGINT},", |
||||
"company_name = #{companyName,jdbcType=VARCHAR},", |
||||
"tax_no = #{taxNo,jdbcType=VARCHAR},", |
||||
"contacts_phone = #{contactsPhone,jdbcType=VARCHAR},", |
||||
"email = #{email,jdbcType=VARCHAR},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"order_child_no = #{orderChildNo,jdbcType=VARCHAR},", |
||||
"oil_no = #{oilNo,jdbcType=VARCHAR},", |
||||
"amount = #{amount,jdbcType=DECIMAL},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"fail_remark = #{failRemark,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsGasOrderReceipt record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsGasOrderReceiptMapperExt { |
||||
} |
@ -0,0 +1,416 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsGasOrderReceipt; |
||||
import com.hfkj.entity.BsGasOrderReceiptExample.Criteria; |
||||
import com.hfkj.entity.BsGasOrderReceiptExample.Criterion; |
||||
import com.hfkj.entity.BsGasOrderReceiptExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsGasOrderReceiptSqlProvider { |
||||
|
||||
public String countByExample(BsGasOrderReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_gas_order_receipt"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsGasOrderReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_gas_order_receipt"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsGasOrderReceipt record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_gas_order_receipt"); |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.VALUES("apply_no", "#{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserReceiptId() != null) { |
||||
sql.VALUES("user_receipt_id", "#{userReceiptId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.VALUES("tax_no", "#{taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.VALUES("contacts_phone", "#{contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.VALUES("email", "#{email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.VALUES("order_child_no", "#{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOilNo() != null) { |
||||
sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getFailRemark() != null) { |
||||
sql.VALUES("fail_remark", "#{failRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsGasOrderReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("apply_no"); |
||||
sql.SELECT("user_receipt_id"); |
||||
sql.SELECT("company_name"); |
||||
sql.SELECT("tax_no"); |
||||
sql.SELECT("contacts_phone"); |
||||
sql.SELECT("email"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("order_child_no"); |
||||
sql.SELECT("oil_no"); |
||||
sql.SELECT("amount"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("fail_remark"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_gas_order_receipt"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsGasOrderReceipt record = (BsGasOrderReceipt) parameter.get("record"); |
||||
BsGasOrderReceiptExample example = (BsGasOrderReceiptExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order_receipt"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserReceiptId() != null) { |
||||
sql.SET("user_receipt_id = #{record.userReceiptId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.SET("email = #{record.email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOilNo() != null) { |
||||
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getFailRemark() != null) { |
||||
sql.SET("fail_remark = #{record.failRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order_receipt"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}"); |
||||
sql.SET("user_receipt_id = #{record.userReceiptId,jdbcType=BIGINT}"); |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}"); |
||||
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("email = #{record.email,jdbcType=VARCHAR}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); |
||||
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("fail_remark = #{record.failRemark,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsGasOrderReceiptExample example = (BsGasOrderReceiptExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsGasOrderReceipt record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order_receipt"); |
||||
|
||||
if (record.getApplyNo() != null) { |
||||
sql.SET("apply_no = #{applyNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserReceiptId() != null) { |
||||
sql.SET("user_receipt_id = #{userReceiptId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.SET("tax_no = #{taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.SET("contacts_phone = #{contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.SET("email = #{email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOilNo() != null) { |
||||
sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAmount() != null) { |
||||
sql.SET("amount = #{amount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getFailRemark() != null) { |
||||
sql.SET("fail_remark = #{failRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsGasOrderReceiptExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,130 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsUserReceipt; |
||||
import com.hfkj.entity.BsUserReceiptExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsUserReceiptMapper extends BsUserReceiptMapperExt { |
||||
@SelectProvider(type=BsUserReceiptSqlProvider.class, method="countByExample") |
||||
long countByExample(BsUserReceiptExample example); |
||||
|
||||
@DeleteProvider(type=BsUserReceiptSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsUserReceiptExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_user_receipt", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_user_receipt (user_id, `type`, ", |
||||
"company_name, tax_no, ", |
||||
"contacts_phone, email, ", |
||||
"`status`, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{userId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ", |
||||
"#{companyName,jdbcType=VARCHAR}, #{taxNo,jdbcType=VARCHAR}, ", |
||||
"#{contactsPhone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsUserReceipt record); |
||||
|
||||
@InsertProvider(type=BsUserReceiptSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsUserReceipt record); |
||||
|
||||
@SelectProvider(type=BsUserReceiptSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsUserReceipt> selectByExample(BsUserReceiptExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, user_id, `type`, company_name, tax_no, contacts_phone, email, `status`, ", |
||||
"create_time, update_time, ext_1, ext_2, ext_3", |
||||
"from bs_user_receipt", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsUserReceipt selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsUserReceipt record, @Param("example") BsUserReceiptExample example); |
||||
|
||||
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsUserReceipt record, @Param("example") BsUserReceiptExample example); |
||||
|
||||
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsUserReceipt record); |
||||
|
||||
@Update({ |
||||
"update bs_user_receipt", |
||||
"set user_id = #{userId,jdbcType=BIGINT},", |
||||
"`type` = #{type,jdbcType=INTEGER},", |
||||
"company_name = #{companyName,jdbcType=VARCHAR},", |
||||
"tax_no = #{taxNo,jdbcType=VARCHAR},", |
||||
"contacts_phone = #{contactsPhone,jdbcType=VARCHAR},", |
||||
"email = #{email,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsUserReceipt record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsUserReceiptMapperExt { |
||||
} |
@ -0,0 +1,346 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsUserReceipt; |
||||
import com.hfkj.entity.BsUserReceiptExample.Criteria; |
||||
import com.hfkj.entity.BsUserReceiptExample.Criterion; |
||||
import com.hfkj.entity.BsUserReceiptExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsUserReceiptSqlProvider { |
||||
|
||||
public String countByExample(BsUserReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_user_receipt"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsUserReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_user_receipt"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsUserReceipt record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_user_receipt"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.VALUES("tax_no", "#{taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.VALUES("contacts_phone", "#{contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.VALUES("email", "#{email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsUserReceiptExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("`type`"); |
||||
sql.SELECT("company_name"); |
||||
sql.SELECT("tax_no"); |
||||
sql.SELECT("contacts_phone"); |
||||
sql.SELECT("email"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_user_receipt"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsUserReceipt record = (BsUserReceipt) parameter.get("record"); |
||||
BsUserReceiptExample example = (BsUserReceiptExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_user_receipt"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.SET("email = #{record.email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_user_receipt"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); |
||||
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}"); |
||||
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("email = #{record.email,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsUserReceiptExample example = (BsUserReceiptExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsUserReceipt record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_user_receipt"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCompanyName() != null) { |
||||
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTaxNo() != null) { |
||||
sql.SET("tax_no = #{taxNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactsPhone() != null) { |
||||
sql.SET("contacts_phone = #{contactsPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEmail() != null) { |
||||
sql.SET("email = #{email,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsUserReceiptExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,326 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_gas_order_receipt |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsGasOrderReceipt implements Serializable { |
||||
private Long id; |
||||
|
||||
/** |
||||
* 申请单号 |
||||
*/ |
||||
private String applyNo; |
||||
|
||||
/** |
||||
* 用户收据信息id |
||||
*/ |
||||
private Long userReceiptId; |
||||
|
||||
/** |
||||
* 公司名称 |
||||
*/ |
||||
private String companyName; |
||||
|
||||
/** |
||||
* 税号 |
||||
*/ |
||||
private String taxNo; |
||||
|
||||
/** |
||||
* 联系人手机号 |
||||
*/ |
||||
private String contactsPhone; |
||||
|
||||
/** |
||||
* 邮箱 |
||||
*/ |
||||
private String email; |
||||
|
||||
/** |
||||
* 交易订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 商品订单号 |
||||
*/ |
||||
private String orderChildNo; |
||||
|
||||
/** |
||||
* 油号 |
||||
*/ |
||||
private String oilNo; |
||||
|
||||
/** |
||||
* 收据金额 |
||||
*/ |
||||
private BigDecimal amount; |
||||
|
||||
/** |
||||
* 状态: 1:待处理 2:开票成功 3:开票失败 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 失败备注 |
||||
*/ |
||||
private String failRemark; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getApplyNo() { |
||||
return applyNo; |
||||
} |
||||
|
||||
public void setApplyNo(String applyNo) { |
||||
this.applyNo = applyNo; |
||||
} |
||||
|
||||
public Long getUserReceiptId() { |
||||
return userReceiptId; |
||||
} |
||||
|
||||
public void setUserReceiptId(Long userReceiptId) { |
||||
this.userReceiptId = userReceiptId; |
||||
} |
||||
|
||||
public String getCompanyName() { |
||||
return companyName; |
||||
} |
||||
|
||||
public void setCompanyName(String companyName) { |
||||
this.companyName = companyName; |
||||
} |
||||
|
||||
public String getTaxNo() { |
||||
return taxNo; |
||||
} |
||||
|
||||
public void setTaxNo(String taxNo) { |
||||
this.taxNo = taxNo; |
||||
} |
||||
|
||||
public String getContactsPhone() { |
||||
return contactsPhone; |
||||
} |
||||
|
||||
public void setContactsPhone(String contactsPhone) { |
||||
this.contactsPhone = contactsPhone; |
||||
} |
||||
|
||||
public String getEmail() { |
||||
return email; |
||||
} |
||||
|
||||
public void setEmail(String email) { |
||||
this.email = email; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getOrderChildNo() { |
||||
return orderChildNo; |
||||
} |
||||
|
||||
public void setOrderChildNo(String orderChildNo) { |
||||
this.orderChildNo = orderChildNo; |
||||
} |
||||
|
||||
public String getOilNo() { |
||||
return oilNo; |
||||
} |
||||
|
||||
public void setOilNo(String oilNo) { |
||||
this.oilNo = oilNo; |
||||
} |
||||
|
||||
public BigDecimal getAmount() { |
||||
return amount; |
||||
} |
||||
|
||||
public void setAmount(BigDecimal amount) { |
||||
this.amount = amount; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getFailRemark() { |
||||
return failRemark; |
||||
} |
||||
|
||||
public void setFailRemark(String failRemark) { |
||||
this.failRemark = failRemark; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsGasOrderReceipt other = (BsGasOrderReceipt) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo())) |
||||
&& (this.getUserReceiptId() == null ? other.getUserReceiptId() == null : this.getUserReceiptId().equals(other.getUserReceiptId())) |
||||
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) |
||||
&& (this.getTaxNo() == null ? other.getTaxNo() == null : this.getTaxNo().equals(other.getTaxNo())) |
||||
&& (this.getContactsPhone() == null ? other.getContactsPhone() == null : this.getContactsPhone().equals(other.getContactsPhone())) |
||||
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getOrderChildNo() == null ? other.getOrderChildNo() == null : this.getOrderChildNo().equals(other.getOrderChildNo())) |
||||
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) |
||||
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getFailRemark() == null ? other.getFailRemark() == null : this.getFailRemark().equals(other.getFailRemark())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode()); |
||||
result = prime * result + ((getUserReceiptId() == null) ? 0 : getUserReceiptId().hashCode()); |
||||
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); |
||||
result = prime * result + ((getTaxNo() == null) ? 0 : getTaxNo().hashCode()); |
||||
result = prime * result + ((getContactsPhone() == null) ? 0 : getContactsPhone().hashCode()); |
||||
result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getOrderChildNo() == null) ? 0 : getOrderChildNo().hashCode()); |
||||
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); |
||||
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getFailRemark() == null) ? 0 : getFailRemark().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", applyNo=").append(applyNo); |
||||
sb.append(", userReceiptId=").append(userReceiptId); |
||||
sb.append(", companyName=").append(companyName); |
||||
sb.append(", taxNo=").append(taxNo); |
||||
sb.append(", contactsPhone=").append(contactsPhone); |
||||
sb.append(", email=").append(email); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", orderChildNo=").append(orderChildNo); |
||||
sb.append(", oilNo=").append(oilNo); |
||||
sb.append(", amount=").append(amount); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", failRemark=").append(failRemark); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,245 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_user_receipt |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsUserReceipt implements Serializable { |
||||
private Long id; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 类型 1:企业 2:个人 |
||||
*/ |
||||
private Integer type; |
||||
|
||||
/** |
||||
* 公司名称 |
||||
*/ |
||||
private String companyName; |
||||
|
||||
/** |
||||
* 税号 |
||||
*/ |
||||
private String taxNo; |
||||
|
||||
/** |
||||
* 联系人手机号 |
||||
*/ |
||||
private String contactsPhone; |
||||
|
||||
/** |
||||
* 邮箱 |
||||
*/ |
||||
private String email; |
||||
|
||||
/** |
||||
* 状态: 0:不可用 1:可用 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getCompanyName() { |
||||
return companyName; |
||||
} |
||||
|
||||
public void setCompanyName(String companyName) { |
||||
this.companyName = companyName; |
||||
} |
||||
|
||||
public String getTaxNo() { |
||||
return taxNo; |
||||
} |
||||
|
||||
public void setTaxNo(String taxNo) { |
||||
this.taxNo = taxNo; |
||||
} |
||||
|
||||
public String getContactsPhone() { |
||||
return contactsPhone; |
||||
} |
||||
|
||||
public void setContactsPhone(String contactsPhone) { |
||||
this.contactsPhone = contactsPhone; |
||||
} |
||||
|
||||
public String getEmail() { |
||||
return email; |
||||
} |
||||
|
||||
public void setEmail(String email) { |
||||
this.email = email; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsUserReceipt other = (BsUserReceipt) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) |
||||
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) |
||||
&& (this.getTaxNo() == null ? other.getTaxNo() == null : this.getTaxNo().equals(other.getTaxNo())) |
||||
&& (this.getContactsPhone() == null ? other.getContactsPhone() == null : this.getContactsPhone().equals(other.getContactsPhone())) |
||||
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); |
||||
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); |
||||
result = prime * result + ((getTaxNo() == null) ? 0 : getTaxNo().hashCode()); |
||||
result = prime * result + ((getContactsPhone() == null) ? 0 : getContactsPhone().hashCode()); |
||||
result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", userId=").append(userId); |
||||
sb.append(", type=").append(type); |
||||
sb.append(", companyName=").append(companyName); |
||||
sb.append(", taxNo=").append(taxNo); |
||||
sb.append(", contactsPhone=").append(contactsPhone); |
||||
sb.append(", email=").append(email); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,61 @@ |
||||
package com.hfkj.service.gas; |
||||
|
||||
import com.hfkj.entity.BsGasOrderReceipt; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsGasOrderReceiptService |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
public interface BsGasOrderReceiptService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsGasOrderReceipt data); |
||||
|
||||
/** |
||||
* 申请 |
||||
* @param userReceiptId |
||||
* @param orderNos |
||||
*/ |
||||
|
||||
void applyReceipt(Long userReceiptId, List<String> orderNos); |
||||
|
||||
/** |
||||
* 开票成功 |
||||
* @param applyNo |
||||
*/ |
||||
void success(String applyNo); |
||||
|
||||
/** |
||||
* 开票失败 |
||||
* @param applyNo |
||||
*/ |
||||
void fail(String applyNo, String remark); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param applyNo |
||||
*/ |
||||
BsGasOrderReceipt getDetail(String applyNo); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param orderReceiptId |
||||
* @return |
||||
*/ |
||||
BsGasOrderReceipt getDetail(Long orderReceiptId); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsGasOrderReceipt> getList(Map<String,Object> param); |
||||
|
||||
} |
@ -0,0 +1,184 @@ |
||||
package com.hfkj.service.gas.impl; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.dao.BsGasOrderReceiptMapper; |
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsGasOrderReceipt; |
||||
import com.hfkj.entity.BsGasOrderReceiptExample; |
||||
import com.hfkj.entity.BsUserReceipt; |
||||
import com.hfkj.service.gas.BsGasOrderReceiptService; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.service.user.BsUserReceiptService; |
||||
import com.hfkj.sysenum.gas.GasOrderReceiptStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Arrays; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.util.stream.IntStream; |
||||
|
||||
/** |
||||
* @className: BsGasOrderReceiptServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
@Service("gasOrderReceiptServiceImpl") |
||||
public class BsGasOrderReceiptServiceImpl implements BsGasOrderReceiptService { |
||||
@Resource |
||||
private BsGasOrderReceiptMapper gasOrderReceiptMapper; |
||||
@Resource |
||||
private BsUserReceiptService userReceiptService; |
||||
@Resource |
||||
private BsGasOrderService gasOrderService; |
||||
|
||||
@Override |
||||
public void editData(BsGasOrderReceipt data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
gasOrderReceiptMapper.insert(data); |
||||
} else { |
||||
gasOrderReceiptMapper.updateByPrimaryKeySelective(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
||||
public void applyReceipt(Long userReceiptId, List<String> orderNos) { |
||||
// 查询收据
|
||||
BsUserReceipt receipt = userReceiptService.getDetail(userReceiptId); |
||||
if (receipt == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的收据"); |
||||
} |
||||
for (Object orderNo : orderNos) { |
||||
// 查询订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderNo.toString()); |
||||
if (gasOrder == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, orderNo+"未知的订单"); |
||||
} |
||||
if (!GasOrderReceiptStatusEnum.status0.getStatus().equals(gasOrder.getReceiptStatus()) |
||||
&& !GasOrderReceiptStatusEnum.status3.getStatus().equals(gasOrder.getReceiptStatus())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, gasOrder.getOrderNo()+"订单未处于未开票状态"); |
||||
} |
||||
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status1.getStatus()); |
||||
gasOrder.setReceiptFailRemark(null); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
|
||||
BsGasOrderReceipt gasOrderReceipt = new BsGasOrderReceipt(); |
||||
gasOrderReceipt.setApplyNo(System.currentTimeMillis()+""); |
||||
gasOrderReceipt.setUserReceiptId(receipt.getUserId()); |
||||
gasOrderReceipt.setCompanyName(receipt.getCompanyName()); |
||||
gasOrderReceipt.setTaxNo(receipt.getTaxNo()); |
||||
gasOrderReceipt.setContactsPhone(receipt.getContactsPhone()); |
||||
gasOrderReceipt.setEmail(receipt.getEmail()); |
||||
gasOrderReceipt.setOrderNo(gasOrder.getOrderNo()); |
||||
gasOrderReceipt.setOrderChildNo(gasOrder.getOrderChildNo()); |
||||
gasOrderReceipt.setOilNo(gasOrder.getGasOilNo()); |
||||
gasOrderReceipt.setAmount(gasOrder.getActualPayPrice()); |
||||
gasOrderReceipt.setStatus(GasOrderReceiptStatusEnum.status1.getStatus()); |
||||
editData(gasOrderReceipt); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void success(String applyNo) { |
||||
// 查询详情
|
||||
BsGasOrderReceipt orderReceipt = getDetail(applyNo); |
||||
if (orderReceipt == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
if (!GasOrderReceiptStatusEnum.status1.getStatus().equals(orderReceipt.getStatus())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "申请状态错误"); |
||||
} |
||||
orderReceipt.setStatus(GasOrderReceiptStatusEnum.status2.getStatus()); |
||||
editData(orderReceipt); |
||||
|
||||
// 查询订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderReceipt.getOrderNo()); |
||||
if (gasOrder != null) { |
||||
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status2.getStatus()); |
||||
gasOrder.setReceiptFailRemark(null); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void fail(String applyNo, String remark) { |
||||
// 查询详情
|
||||
BsGasOrderReceipt orderReceipt = getDetail(applyNo); |
||||
if (orderReceipt == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请"); |
||||
} |
||||
if (!GasOrderReceiptStatusEnum.status1.getStatus().equals(orderReceipt.getStatus())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "申请状态错误"); |
||||
} |
||||
orderReceipt.setStatus(GasOrderReceiptStatusEnum.status3.getStatus()); |
||||
orderReceipt.setFailRemark(remark); |
||||
editData(orderReceipt); |
||||
|
||||
// 查询订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderReceipt.getOrderNo()); |
||||
if (gasOrder != null) { |
||||
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status3.getStatus()); |
||||
gasOrder.setReceiptFailRemark(remark); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsGasOrderReceipt getDetail(String applyNo) { |
||||
BsGasOrderReceiptExample example = new BsGasOrderReceiptExample(); |
||||
example.createCriteria().andApplyNoEqualTo(applyNo); |
||||
List<BsGasOrderReceipt> list = gasOrderReceiptMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsGasOrderReceipt getDetail(Long orderReceiptId) { |
||||
return gasOrderReceiptMapper.selectByPrimaryKey(orderReceiptId); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsGasOrderReceipt> getList(Map<String, Object> param) { |
||||
BsGasOrderReceiptExample example = new BsGasOrderReceiptExample(); |
||||
BsGasOrderReceiptExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { |
||||
criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "contactsPhone"))) { |
||||
criteria.andContactsPhoneLike("%"+MapUtils.getString(param, "contactsPhone")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) { |
||||
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(",")) |
||||
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed() |
||||
.collect(Collectors.toList()); |
||||
criteria.andStatusIn(status); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeS") != null) { |
||||
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeE") != null) { |
||||
criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return gasOrderReceiptMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
package com.hfkj.service.user; |
||||
|
||||
import com.hfkj.entity.BsUserReceipt; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsUserReceiptService |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
public interface BsUserReceiptService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsUserReceipt data); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param id |
||||
*/ |
||||
BsUserReceipt getDetail(Long id); |
||||
|
||||
/** |
||||
* 查询列表 |
||||
* @param param |
||||
*/ |
||||
List<BsUserReceipt> getList(Map<String,Object> param); |
||||
|
||||
} |
@ -0,0 +1,64 @@ |
||||
package com.hfkj.service.user.impl; |
||||
|
||||
import com.hfkj.dao.BsUserReceiptMapper; |
||||
import com.hfkj.entity.BsUserReceipt; |
||||
import com.hfkj.entity.BsUserReceiptExample; |
||||
import com.hfkj.service.user.BsUserReceiptService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Arrays; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.util.stream.IntStream; |
||||
|
||||
/** |
||||
* @className: BsUserReceiptServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/7/24 |
||||
**/ |
||||
@Service("userReceiptService") |
||||
public class BsUserReceiptServiceImpl implements BsUserReceiptService { |
||||
@Resource |
||||
private BsUserReceiptMapper userReceiptMapper; |
||||
|
||||
@Override |
||||
public void editData(BsUserReceipt data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
userReceiptMapper.insert(data); |
||||
} else { |
||||
userReceiptMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsUserReceipt getDetail(Long id) { |
||||
return userReceiptMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsUserReceipt> getList(Map<String, Object> param) { |
||||
BsUserReceiptExample example = new BsUserReceiptExample(); |
||||
BsUserReceiptExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); |
||||
|
||||
if (MapUtils.getLong(param, "userId") != null) { |
||||
criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) { |
||||
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(",")) |
||||
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed() |
||||
.collect(Collectors.toList()); |
||||
criteria.andStatusIn(status); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return userReceiptMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.sysenum.gas; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 加油站价格任务 |
||||
* @author hurui |
||||
*/ |
||||
@Getter |
||||
public enum GasOrderReceiptStatusEnum { |
||||
/** |
||||
* 未开票 |
||||
*/ |
||||
status0(0 , "未开票", ""), |
||||
/** |
||||
* 待处理 |
||||
*/ |
||||
status1(1 , "处理中", "待处理"), |
||||
/** |
||||
* 开票成功 |
||||
*/ |
||||
status2(2 , "开票成功", "开票成功"), |
||||
/** |
||||
* 开票失败 |
||||
*/ |
||||
status3(3 , "开票失败", "开票失败"), |
||||
; |
||||
|
||||
private Integer status; |
||||
private String userName; |
||||
private String manageName; |
||||
|
||||
GasOrderReceiptStatusEnum(int status, String userName, String manageName) { |
||||
this.status = status; |
||||
this.userName = userName; |
||||
this.manageName = manageName; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue