4 changed files with 480 additions and 0 deletions
@ -0,0 +1,276 @@ |
|||||
|
package cn.chjyj.szwh.bean; |
||||
|
|
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 用户账单 |
||||
|
*/ |
||||
|
public class UserAccountBill { |
||||
|
/** |
||||
|
* user_account_bill |
||||
|
* id,user_isli as userIsli,batchcode,order_user_id as orderUserId,center_number as centerNumber |
||||
|
* center_name as centerNumber,service_number as serviceNumber,service_name as serviceName, |
||||
|
* service_charge as serviceCharge,thatday_buy_money as thatdayBuyMoney,preliminary_capital as preliminaryCapital, |
||||
|
* available_capital as availableCapital,disburse_capital as disburseCapital,entrust_cost as entrustCost, |
||||
|
* thatday_sale_money as thatdaySaleMoney,service_charge_allot as serviceChargeAllot,capital_remaining as capitalRemaining, |
||||
|
* freeze_earnest_money as freezeEarnestMoney,createtime,close_time as closeTime |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* 用户ISLI码 |
||||
|
*/ |
||||
|
private String userIsli; |
||||
|
|
||||
|
/** |
||||
|
* 订单号 |
||||
|
*/ |
||||
|
private String batchcode; |
||||
|
|
||||
|
/** |
||||
|
* 订单用户信息ID |
||||
|
*/ |
||||
|
private Integer orderUserId; |
||||
|
|
||||
|
/** |
||||
|
* 分中心编号 |
||||
|
*/ |
||||
|
private String centerNumber; |
||||
|
|
||||
|
/** |
||||
|
* 分中心名称 |
||||
|
*/ |
||||
|
private String centerName; |
||||
|
|
||||
|
/** |
||||
|
* 服务机构编号 |
||||
|
*/ |
||||
|
private String serviceNumber; |
||||
|
|
||||
|
/** |
||||
|
* 服务机构名称 |
||||
|
*/ |
||||
|
private String serviceName; |
||||
|
|
||||
|
/** |
||||
|
* 佣金/服务费 |
||||
|
*/ |
||||
|
private BigDecimal serviceCharge; |
||||
|
|
||||
|
/** |
||||
|
* 当日买入金额 |
||||
|
*/ |
||||
|
private BigDecimal thatdayBuyMoney; |
||||
|
|
||||
|
/** |
||||
|
* 期初资金 |
||||
|
*/ |
||||
|
private BigDecimal preliminaryCapital; |
||||
|
|
||||
|
/** |
||||
|
* 可用资金 |
||||
|
*/ |
||||
|
private BigDecimal availableCapital; |
||||
|
|
||||
|
/** |
||||
|
* 可出资金 |
||||
|
*/ |
||||
|
private BigDecimal disburseCapital; |
||||
|
|
||||
|
/** |
||||
|
* 委托费 |
||||
|
*/ |
||||
|
private BigDecimal entrustCost; |
||||
|
|
||||
|
/** |
||||
|
* 当日卖出金额 |
||||
|
*/ |
||||
|
private BigDecimal thatdaySaleMoney; |
||||
|
|
||||
|
/** |
||||
|
* 服务费分配 |
||||
|
*/ |
||||
|
private BigDecimal serviceChargeAllot; |
||||
|
|
||||
|
/** |
||||
|
* 资金余额 |
||||
|
*/ |
||||
|
private BigDecimal capitalRemaining; |
||||
|
|
||||
|
/** |
||||
|
* 冻结保证金 |
||||
|
*/ |
||||
|
private BigDecimal freezeEarnestMoney; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createtime; |
||||
|
|
||||
|
/** |
||||
|
* 结算时间 |
||||
|
*/ |
||||
|
private Date closeTime; |
||||
|
|
||||
|
public Integer getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Integer id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getUserIsli() { |
||||
|
return userIsli; |
||||
|
} |
||||
|
|
||||
|
public void setUserIsli(String userIsli) { |
||||
|
this.userIsli = userIsli; |
||||
|
} |
||||
|
|
||||
|
public String getBatchcode() { |
||||
|
return batchcode; |
||||
|
} |
||||
|
|
||||
|
public void setBatchcode(String batchcode) { |
||||
|
this.batchcode = batchcode; |
||||
|
} |
||||
|
|
||||
|
public Integer getOrderUserId() { |
||||
|
return orderUserId; |
||||
|
} |
||||
|
|
||||
|
public void setOrderUserId(Integer orderUserId) { |
||||
|
this.orderUserId = orderUserId; |
||||
|
} |
||||
|
|
||||
|
public String getCenterNumber() { |
||||
|
return centerNumber; |
||||
|
} |
||||
|
|
||||
|
public void setCenterNumber(String centerNumber) { |
||||
|
this.centerNumber = centerNumber; |
||||
|
} |
||||
|
|
||||
|
public String getCenterName() { |
||||
|
return centerName; |
||||
|
} |
||||
|
|
||||
|
public void setCenterName(String centerName) { |
||||
|
this.centerName = centerName; |
||||
|
} |
||||
|
|
||||
|
public String getServiceNumber() { |
||||
|
return serviceNumber; |
||||
|
} |
||||
|
|
||||
|
public void setServiceNumber(String serviceNumber) { |
||||
|
this.serviceNumber = serviceNumber; |
||||
|
} |
||||
|
|
||||
|
public String getServiceName() { |
||||
|
return serviceName; |
||||
|
} |
||||
|
|
||||
|
public void setServiceName(String serviceName) { |
||||
|
this.serviceName = serviceName; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getServiceCharge() { |
||||
|
return serviceCharge; |
||||
|
} |
||||
|
|
||||
|
public void setServiceCharge(BigDecimal serviceCharge) { |
||||
|
this.serviceCharge = serviceCharge; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getThatdayBuyMoney() { |
||||
|
return thatdayBuyMoney; |
||||
|
} |
||||
|
|
||||
|
public void setThatdayBuyMoney(BigDecimal thatdayBuyMoney) { |
||||
|
this.thatdayBuyMoney = thatdayBuyMoney; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getPreliminaryCapital() { |
||||
|
return preliminaryCapital; |
||||
|
} |
||||
|
|
||||
|
public void setPreliminaryCapital(BigDecimal preliminaryCapital) { |
||||
|
this.preliminaryCapital = preliminaryCapital; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getAvailableCapital() { |
||||
|
return availableCapital; |
||||
|
} |
||||
|
|
||||
|
public void setAvailableCapital(BigDecimal availableCapital) { |
||||
|
this.availableCapital = availableCapital; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getDisburseCapital() { |
||||
|
return disburseCapital; |
||||
|
} |
||||
|
|
||||
|
public void setDisburseCapital(BigDecimal disburseCapital) { |
||||
|
this.disburseCapital = disburseCapital; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getEntrustCost() { |
||||
|
return entrustCost; |
||||
|
} |
||||
|
|
||||
|
public void setEntrustCost(BigDecimal entrustCost) { |
||||
|
this.entrustCost = entrustCost; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getThatdaySaleMoney() { |
||||
|
return thatdaySaleMoney; |
||||
|
} |
||||
|
|
||||
|
public void setThatdaySaleMoney(BigDecimal thatdaySaleMoney) { |
||||
|
this.thatdaySaleMoney = thatdaySaleMoney; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getServiceChargeAllot() { |
||||
|
return serviceChargeAllot; |
||||
|
} |
||||
|
|
||||
|
public void setServiceChargeAllot(BigDecimal serviceChargeAllot) { |
||||
|
this.serviceChargeAllot = serviceChargeAllot; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getCapitalRemaining() { |
||||
|
return capitalRemaining; |
||||
|
} |
||||
|
|
||||
|
public void setCapitalRemaining(BigDecimal capitalRemaining) { |
||||
|
this.capitalRemaining = capitalRemaining; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getFreezeEarnestMoney() { |
||||
|
return freezeEarnestMoney; |
||||
|
} |
||||
|
|
||||
|
public void setFreezeEarnestMoney(BigDecimal freezeEarnestMoney) { |
||||
|
this.freezeEarnestMoney = freezeEarnestMoney; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatetime() { |
||||
|
return createtime; |
||||
|
} |
||||
|
|
||||
|
public void setCreatetime(Date createtime) { |
||||
|
this.createtime = createtime; |
||||
|
} |
||||
|
|
||||
|
public Date getCloseTime() { |
||||
|
return closeTime; |
||||
|
} |
||||
|
|
||||
|
public void setCloseTime(Date closeTime) { |
||||
|
this.closeTime = closeTime; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package cn.chjyj.szwh.mapper; |
||||
|
|
||||
|
import cn.chjyj.szwh.bean.UserAccountBill; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Component |
||||
|
public interface UserAccountBillMapper { |
||||
|
/** |
||||
|
* 用户的账单明细 |
||||
|
* @param userisli |
||||
|
* @param statrs |
||||
|
* @param limit |
||||
|
* @return |
||||
|
*/ |
||||
|
List<UserAccountBill> getUserAccBill(@Param("userisli") String userisli, |
||||
|
@Param("startrs") int statrs, |
||||
|
@Param("limit") int limit); |
||||
|
} |
||||
@ -0,0 +1,152 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="cn.chjyj.szwh.mapper.UserAccountBillMapper"> |
||||
|
|
||||
|
<sql id="column"> |
||||
|
id,user_isli as userIsli,batchcode,order_user_id as orderUserId,center_number as centerNumber, |
||||
|
center_name as centerNumber,service_number as serviceNumber,service_name as serviceName, |
||||
|
service_charge as serviceCharge,thatday_buy_money as thatdayBuyMoney,preliminary_capital as preliminaryCapital, |
||||
|
available_capital as availableCapital,disburse_capital as disburseCapital,entrust_cost as entrustCost, |
||||
|
thatday_sale_money as thatdaySaleMoney,service_charge_allot as serviceChargeAllot,capital_remaining as capitalRemaining, |
||||
|
freeze_earnest_money as freezeEarnestMoney,createtime,close_time as closeTime |
||||
|
</sql> |
||||
|
<sql id="tbName">user_account_bill</sql> |
||||
|
|
||||
|
<!--查询记录列表--> |
||||
|
<select id="getUserAccBill" resultType="cn.chjyj.szwh.bean.UserAccountBill"> |
||||
|
select <include refid="column"/> |
||||
|
from <include refid="tbName"/> |
||||
|
where user_isli=#{userisli} |
||||
|
and id>#{startrs} |
||||
|
limit #{limit} |
||||
|
</select> |
||||
|
|
||||
|
<!--查询用户名,加上密码--> |
||||
|
<select id="getUserByIsli" parameterType="java.lang.String" resultType="cn.chjyj.szwh.bean.User"> |
||||
|
select<include refid="column"/>,password |
||||
|
from |
||||
|
<include refid="tbName"/> |
||||
|
where user_isli=#{userIsli} limit 1; |
||||
|
</select> |
||||
|
|
||||
|
<!--查询用户--> |
||||
|
<select id="getSingleUserByOpenid" parameterType="java.lang.String" resultType="cn.chjyj.szwh.bean.Goods"> |
||||
|
select |
||||
|
<include refid="column"/> |
||||
|
from |
||||
|
<include refid="tbName"/> |
||||
|
where openid=#{openid}; |
||||
|
</select> |
||||
|
|
||||
|
<!--新增用户--> |
||||
|
<insert id="addUser" parameterType="cn.chjyj.szwh.bean.Goods" useGeneratedKeys="true" keyColumn="uid"> |
||||
|
insert into |
||||
|
<include refid="tbName"/> |
||||
|
(user_isli,username,institution_code,agency_type,cert_type,idNumber,cell_phone, |
||||
|
bank_account,legals_name,legals_type,legals_idnum,legals_phone,bank_card_type, |
||||
|
bank_type,bank_name,bank_username,bank_userid,bank_userphone,bank_address,attest_status, |
||||
|
registertime,attesttime |
||||
|
) |
||||
|
values ( |
||||
|
#{userIsli}, |
||||
|
#{username}, |
||||
|
#{institutionCode}, |
||||
|
#{agencyType}, |
||||
|
#{certType}, |
||||
|
#{idNumber}, |
||||
|
#{cellPhone}, |
||||
|
#{bankAccount}, |
||||
|
#{legalsName}, |
||||
|
#{legalsType}, |
||||
|
#{legalsIdnum}, |
||||
|
#{legalsPhone}, |
||||
|
#{bankCardType}, |
||||
|
#{bankType}, |
||||
|
#{bankName}, |
||||
|
#{bankUsername}, |
||||
|
#{bankUserid}, |
||||
|
#{bankUserphone}, |
||||
|
#{bankAddress}, |
||||
|
#{attestStatus}, |
||||
|
#{registertime}, |
||||
|
#{attesttime} |
||||
|
) |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateUser" parameterType="cn.chjyj.szwh.bean.Goods"> |
||||
|
update |
||||
|
<include refid="tbName"/> |
||||
|
<set> |
||||
|
<if test="userIsli!=null"> |
||||
|
user_isli=#{userIsli}, |
||||
|
</if> |
||||
|
<if test="username!=null"> |
||||
|
username=#{username}, |
||||
|
</if> |
||||
|
<if test="institutionCode!=null"> |
||||
|
institution_code =#{institutionCode}, |
||||
|
</if> |
||||
|
<if test="agencyType!=null"> |
||||
|
agency_type=#{agencyType} |
||||
|
</if> |
||||
|
<if test="certType!=null"> |
||||
|
cert_type=#{certType} |
||||
|
</if> |
||||
|
<if test="idNumber!=null"> |
||||
|
idNumber=#{idNumber} |
||||
|
</if> |
||||
|
<if test="cellPhone!=null"> |
||||
|
cell_phone=#{cellPhone} |
||||
|
</if> |
||||
|
<if test="bankAccount!=null"> |
||||
|
bank_account=#{bankAccount} |
||||
|
</if> |
||||
|
<if test="legalsName!=null"> |
||||
|
legals_name=#{legalsName} |
||||
|
</if> |
||||
|
<if test="legalsType!=null"> |
||||
|
legals_type=#{legalsType} |
||||
|
</if> |
||||
|
<if test="legalsIdnum!=null"> |
||||
|
legals_idnum=#{legalsIdnum} |
||||
|
</if> |
||||
|
<if test="legalsPhone!=null"> |
||||
|
legals_phone=#{legalsPhone} |
||||
|
</if> |
||||
|
<if test="bankCardType!=null"> |
||||
|
bank_card_type=#{bankCardType} |
||||
|
</if> |
||||
|
<if test="bankType!=null"> |
||||
|
bank_type=#{bankType} |
||||
|
</if> |
||||
|
<if test="bankName!=null"> |
||||
|
bank_name=#{bankName} |
||||
|
</if> |
||||
|
<if test="bankUsername!=null"> |
||||
|
bank_username=#{bankUsername} |
||||
|
</if> |
||||
|
<if test="bankUserid!=null"> |
||||
|
bank_userid=#{bankUserid} |
||||
|
</if> |
||||
|
<if test="bankUserphone!=null"> |
||||
|
bank_userphone=#{bankUserphone} |
||||
|
</if> |
||||
|
<if test="bankAddress!=null"> |
||||
|
bank_address=#{bankAddress} |
||||
|
</if> |
||||
|
<if test="attestStatus!=null"> |
||||
|
attest_status=#{attestStatus} |
||||
|
</if> |
||||
|
<if test="registertime!=null"> |
||||
|
registertime=#{registertime} |
||||
|
</if> |
||||
|
<if test="attesttime!=null"> |
||||
|
attesttime=#{} |
||||
|
</if> |
||||
|
</set> |
||||
|
where id=#{id}; |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,30 @@ |
|||||
|
package cn.chjyj.szwh.mapper; |
||||
|
|
||||
|
import cn.chjyj.szwh.bean.UserAccountBill; |
||||
|
import org.junit.Test; |
||||
|
import org.junit.runner.RunWith; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
import org.springframework.test.context.junit4.SpringRunner; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import static org.junit.Assert.*; |
||||
|
|
||||
|
@SpringBootTest |
||||
|
@RunWith(SpringRunner.class) |
||||
|
public class UserAccountBillMapperTest { |
||||
|
@Autowired |
||||
|
private UserAccountBillMapper userAccountBillMapper; |
||||
|
|
||||
|
@Test |
||||
|
public void getUserAccBill() { |
||||
|
String userisli = "999998-000000001874-8"; |
||||
|
int startrs=0; |
||||
|
int limit =20; |
||||
|
List<UserAccountBill> ucblist = userAccountBillMapper.getUserAccBill(userisli,startrs,limit); |
||||
|
for(UserAccountBill ua:ucblist){ |
||||
|
System.out.println(ua.getCenterName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue