parent
13e87fb9d9
commit
99687e14d5
@ -1,5 +1,84 @@
|
||||
package com.infincash.cron.collection;
|
||||
|
||||
public class CronCollectionServiceImpl implements CronCollectionService{
|
||||
import static com.infincash.util.Jdk8DateUtils.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.infincash.cron.collection.mapper.TBizCollectionOverdueBucketMapper;
|
||||
import com.infincash.cron.collection.mapper.TBizCollectionRecordMapper;
|
||||
import com.infincash.cron.collection.table.TBizCollectionOverdueBucket;
|
||||
import com.infincash.cron.collection.table.TBizCollectionRecord;
|
||||
import com.xxl.job.core.log.XxlJobLogger;
|
||||
|
||||
public class CronCollectionServiceImpl implements CronCollectionService
|
||||
{
|
||||
@Autowired
|
||||
TBizCollectionRecordMapper recordMapper;
|
||||
|
||||
@Autowired
|
||||
TBizCollectionOverdueBucketMapper bucketMapper;
|
||||
|
||||
@Override
|
||||
public void assignCollection() throws InfintechException
|
||||
{
|
||||
//90天以上的是坏账
|
||||
String badDebtDay = getDateAfter(-90);
|
||||
List<TBizCollectionRecord> rList = recordMapper.queryAll(badDebtDay);
|
||||
if (rList == null || rList.size() == 0)
|
||||
{
|
||||
throw new InfintechException("recordMapper.queryAll(badDebtDay) empty! badDebtDay: " + badDebtDay);
|
||||
}
|
||||
List<TBizCollectionOverdueBucket> bList = bucketMapper.queryAll();
|
||||
if (bList == null || bList.size() == 0)
|
||||
{
|
||||
throw new InfintechException("bucketMapper.queryAll() empty!");
|
||||
}
|
||||
getWhichBucket(bList, rList);
|
||||
}
|
||||
|
||||
private Map<String, List<TBizCollectionRecord>> getWhichBucket(List<TBizCollectionOverdueBucket> bList, List<TBizCollectionRecord> rList)
|
||||
{
|
||||
// <k-v>:= <system_role_id - List<record>>
|
||||
Map<String, List<TBizCollectionRecord>> listMap = Maps.newHashMap();
|
||||
for (TBizCollectionRecord r : rList)
|
||||
{
|
||||
Date d = r.getRepaymentDate();
|
||||
Date now = new Date();
|
||||
long diffDate = dateSubstract(now, d);
|
||||
XxlJobLogger.log("d:" + d.toString() + ", now:" + now.toString() + ", diffDate:" + diffDate);
|
||||
for (int i = 0; i < bList.size() - 1; i++)
|
||||
{
|
||||
long lbegin = bList.get(i).getLeftClosedInterval().longValue();
|
||||
long lend = bList.get(i + 1).getLeftClosedInterval().longValue();
|
||||
if (diffDate >= lbegin && diffDate < lend)
|
||||
{
|
||||
//取system_role
|
||||
String systemRoleId = bList.get(i).gettSystemRoleId();
|
||||
List<TBizCollectionRecord> tmpList = listMap.get(systemRoleId);
|
||||
if (tmpList == null) {
|
||||
tmpList = Lists.newLinkedList();
|
||||
tmpList.add(r);
|
||||
listMap.put(systemRoleId, tmpList);
|
||||
} else {
|
||||
tmpList.add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return listMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int assignExemployeeCollection()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.infincash.cron.collection;
|
||||
|
||||
public class InfintechException extends Exception {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 807018557994813625L;
|
||||
|
||||
public InfintechException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InfintechException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public InfintechException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
public InfintechException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.infincash.cron.collection.mapper;
|
||||
|
||||
import com.infincash.cron.collection.table.TBizCollectionRecord;
|
||||
|
||||
public interface CronCollectionMapper {
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(TBizCollectionRecord record);
|
||||
|
||||
int insertSelective(TBizCollectionRecord record);
|
||||
|
||||
TBizCollectionRecord selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(TBizCollectionRecord record);
|
||||
|
||||
int updateByPrimaryKey(TBizCollectionRecord record);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.infincash.cron.collection.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.infincash.cron.collection.table.TBizCollectionOverdueBucket;
|
||||
|
||||
public interface TBizCollectionOverdueBucketMapper {
|
||||
List<TBizCollectionOverdueBucket> queryAll();
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.infincash.cron.collection.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.infincash.cron.collection.table.TBizCollectionRecord;
|
||||
|
||||
public interface TBizCollectionRecordMapper {
|
||||
List<TBizCollectionRecord> queryAll(String badDebtDay);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(TBizCollectionRecord record);
|
||||
|
||||
int insertSelective(TBizCollectionRecord record);
|
||||
|
||||
TBizCollectionRecord selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(TBizCollectionRecord record);
|
||||
|
||||
int updateByPrimaryKey(TBizCollectionRecord record);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.infincash.cron.collection.table;
|
||||
|
||||
public class TBizCollectionOverdueBucket {
|
||||
private Short id;
|
||||
|
||||
private Short intervalId;
|
||||
|
||||
private Short leftClosedInterval;
|
||||
|
||||
private String tSystemRoleId;
|
||||
|
||||
public Short getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Short id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Short getIntervalId() {
|
||||
return intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalId(Short intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public Short getLeftClosedInterval() {
|
||||
return leftClosedInterval;
|
||||
}
|
||||
|
||||
public void setLeftClosedInterval(Short leftClosedInterval) {
|
||||
this.leftClosedInterval = leftClosedInterval;
|
||||
}
|
||||
|
||||
public String gettSystemRoleId() {
|
||||
return tSystemRoleId;
|
||||
}
|
||||
|
||||
public void settSystemRoleId(String tSystemRoleId) {
|
||||
this.tSystemRoleId = tSystemRoleId == null ? null : tSystemRoleId.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,240 @@
|
||||
package com.infincash.cron.collection.table;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class TBizCollectionRecord {
|
||||
private Long id;
|
||||
|
||||
private String fkTProject;
|
||||
|
||||
private String fkTUser;
|
||||
|
||||
private String fkSystemUser;
|
||||
|
||||
private String projectNumber;
|
||||
|
||||
private String userLoginName;
|
||||
|
||||
private String userRealName;
|
||||
|
||||
private String userPhone;
|
||||
|
||||
private Date loanTime;
|
||||
|
||||
private Integer deadline;
|
||||
|
||||
private String unit;
|
||||
|
||||
private BigDecimal firstPriceLoan;
|
||||
|
||||
private Date repaymentDate;
|
||||
|
||||
private Short overdueDayCount;
|
||||
|
||||
private Short fkTBizCollectionOverdueBucketIntervalId;
|
||||
|
||||
private String collectorLoginName;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
private Byte state;
|
||||
|
||||
private Date fullRepayDate;
|
||||
|
||||
private Date lastCollectionTime;
|
||||
|
||||
private Date nextCollectionTime;
|
||||
|
||||
private Short histryCollectionCount;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFkTProject() {
|
||||
return fkTProject;
|
||||
}
|
||||
|
||||
public void setFkTProject(String fkTProject) {
|
||||
this.fkTProject = fkTProject == null ? null : fkTProject.trim();
|
||||
}
|
||||
|
||||
public String getFkTUser() {
|
||||
return fkTUser;
|
||||
}
|
||||
|
||||
public void setFkTUser(String fkTUser) {
|
||||
this.fkTUser = fkTUser == null ? null : fkTUser.trim();
|
||||
}
|
||||
|
||||
public String getFkSystemUser() {
|
||||
return fkSystemUser;
|
||||
}
|
||||
|
||||
public void setFkSystemUser(String fkSystemUser) {
|
||||
this.fkSystemUser = fkSystemUser == null ? null : fkSystemUser.trim();
|
||||
}
|
||||
|
||||
public String getProjectNumber() {
|
||||
return projectNumber;
|
||||
}
|
||||
|
||||
public void setProjectNumber(String projectNumber) {
|
||||
this.projectNumber = projectNumber == null ? null : projectNumber.trim();
|
||||
}
|
||||
|
||||
public String getUserLoginName() {
|
||||
return userLoginName;
|
||||
}
|
||||
|
||||
public void setUserLoginName(String userLoginName) {
|
||||
this.userLoginName = userLoginName == null ? null : userLoginName.trim();
|
||||
}
|
||||
|
||||
public String getUserRealName() {
|
||||
return userRealName;
|
||||
}
|
||||
|
||||
public void setUserRealName(String userRealName) {
|
||||
this.userRealName = userRealName == null ? null : userRealName.trim();
|
||||
}
|
||||
|
||||
public String getUserPhone() {
|
||||
return userPhone;
|
||||
}
|
||||
|
||||
public void setUserPhone(String userPhone) {
|
||||
this.userPhone = userPhone == null ? null : userPhone.trim();
|
||||
}
|
||||
|
||||
public Date getLoanTime() {
|
||||
return loanTime;
|
||||
}
|
||||
|
||||
public void setLoanTime(Date loanTime) {
|
||||
this.loanTime = loanTime;
|
||||
}
|
||||
|
||||
public BigDecimal getFirstPriceLoan() {
|
||||
return firstPriceLoan;
|
||||
}
|
||||
|
||||
public void setFirstPriceLoan(BigDecimal firstPriceLoan) {
|
||||
this.firstPriceLoan = firstPriceLoan;
|
||||
}
|
||||
|
||||
public Date getRepaymentDate() {
|
||||
return repaymentDate;
|
||||
}
|
||||
|
||||
public void setRepaymentDate(Date repaymentDate) {
|
||||
this.repaymentDate = repaymentDate;
|
||||
}
|
||||
|
||||
public Short getOverdueDayCount() {
|
||||
return overdueDayCount;
|
||||
}
|
||||
|
||||
public void setOverdueDayCount(Short overdueDayCount) {
|
||||
this.overdueDayCount = overdueDayCount;
|
||||
}
|
||||
|
||||
public Short getFkTBizCollectionOverdueBucketIntervalId() {
|
||||
return fkTBizCollectionOverdueBucketIntervalId;
|
||||
}
|
||||
|
||||
public void setFkTBizCollectionOverdueBucketIntervalId(Short fkTBizCollectionOverdueBucketIntervalId) {
|
||||
this.fkTBizCollectionOverdueBucketIntervalId = fkTBizCollectionOverdueBucketIntervalId;
|
||||
}
|
||||
|
||||
public String getCollectorLoginName() {
|
||||
return collectorLoginName;
|
||||
}
|
||||
|
||||
public void setCollectorLoginName(String collectorLoginName) {
|
||||
this.collectorLoginName = collectorLoginName == null ? null : collectorLoginName.trim();
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy == null ? null : updateBy.trim();
|
||||
}
|
||||
|
||||
public Byte getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Byte state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Date getFullRepayDate() {
|
||||
return fullRepayDate;
|
||||
}
|
||||
|
||||
public void setFullRepayDate(Date fullRepayDate) {
|
||||
this.fullRepayDate = fullRepayDate;
|
||||
}
|
||||
|
||||
public Date getLastCollectionTime() {
|
||||
return lastCollectionTime;
|
||||
}
|
||||
|
||||
public void setLastCollectionTime(Date lastCollectionTime) {
|
||||
this.lastCollectionTime = lastCollectionTime;
|
||||
}
|
||||
|
||||
public Date getNextCollectionTime() {
|
||||
return nextCollectionTime;
|
||||
}
|
||||
|
||||
public void setNextCollectionTime(Date nextCollectionTime) {
|
||||
this.nextCollectionTime = nextCollectionTime;
|
||||
}
|
||||
|
||||
public Short getHistryCollectionCount() {
|
||||
return histryCollectionCount;
|
||||
}
|
||||
|
||||
public void setHistryCollectionCount(Short histryCollectionCount) {
|
||||
this.histryCollectionCount = histryCollectionCount;
|
||||
}
|
||||
|
||||
public Integer getDeadline()
|
||||
{
|
||||
return deadline;
|
||||
}
|
||||
|
||||
public void setDeadline(Integer deadline)
|
||||
{
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.infincash.cron.collection.mapper.TBizCollectionOverdueBucketMapper">
|
||||
<resultMap id="BaseResultMap" type="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
<id column="id" jdbcType="SMALLINT" property="id" />
|
||||
<result column="interval_id" jdbcType="SMALLINT" property="intervalId" />
|
||||
<result column="left_closed_interval" jdbcType="SMALLINT" property="leftClosedInterval" />
|
||||
<result column="t_system_role_id" jdbcType="VARCHAR" property="tSystemRoleId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, interval_id, left_closed_interval, t_system_role_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_biz_collection_overdue_bucket
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
|
||||
delete from t_biz_collection_overdue_bucket
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
insert into t_biz_collection_overdue_bucket (id, interval_id, left_closed_interval,
|
||||
t_system_role_id)
|
||||
values (#{id,jdbcType=SMALLINT}, #{intervalId,jdbcType=SMALLINT}, #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
#{tSystemRoleId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
insert into t_biz_collection_overdue_bucket
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="intervalId != null">
|
||||
interval_id,
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
left_closed_interval,
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
t_system_role_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="intervalId != null">
|
||||
#{intervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
#{leftClosedInterval,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
#{tSystemRoleId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
update t_biz_collection_overdue_bucket
|
||||
<set>
|
||||
<if test="intervalId != null">
|
||||
interval_id = #{intervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
left_closed_interval = #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
t_system_role_id = #{tSystemRoleId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
update t_biz_collection_overdue_bucket
|
||||
set interval_id = #{intervalId,jdbcType=SMALLINT},
|
||||
left_closed_interval = #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
t_system_role_id = #{tSystemRoleId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</update>
|
||||
<resultMap id="BaseResultMap" type="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
<id column="id" jdbcType="SMALLINT" property="id" />
|
||||
<result column="interval_id" jdbcType="SMALLINT" property="intervalId" />
|
||||
<result column="left_closed_interval" jdbcType="SMALLINT" property="leftClosedInterval" />
|
||||
<result column="t_system_role_id" jdbcType="VARCHAR" property="tSystemRoleId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, interval_id, left_closed_interval, t_system_role_id
|
||||
</sql>
|
||||
<select id="queryAll" parameterType="java.lang.Short" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_biz_collection_overdue_bucket
|
||||
order by interval_id
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
|
||||
delete from t_biz_collection_overdue_bucket
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
insert into t_biz_collection_overdue_bucket (id, interval_id, left_closed_interval,
|
||||
t_system_role_id)
|
||||
values (#{id,jdbcType=SMALLINT}, #{intervalId,jdbcType=SMALLINT}, #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
#{tSystemRoleId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
insert into t_biz_collection_overdue_bucket
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="intervalId != null">
|
||||
interval_id,
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
left_closed_interval,
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
t_system_role_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="intervalId != null">
|
||||
#{intervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
#{leftClosedInterval,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
#{tSystemRoleId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
update t_biz_collection_overdue_bucket
|
||||
<set>
|
||||
<if test="intervalId != null">
|
||||
interval_id = #{intervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="leftClosedInterval != null">
|
||||
left_closed_interval = #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="tSystemRoleId != null">
|
||||
t_system_role_id = #{tSystemRoleId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.infincash.cron.collection.table.TBizCollectionOverdueBucket">
|
||||
update t_biz_collection_overdue_bucket
|
||||
set interval_id = #{intervalId,jdbcType=SMALLINT},
|
||||
left_closed_interval = #{leftClosedInterval,jdbcType=SMALLINT},
|
||||
t_system_role_id = #{tSystemRoleId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=SMALLINT}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,261 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.infincash.cron.collection.mapper.TBizCollectionRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.infincash.cron.collection.table.TBizCollectionRecord">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="fk_t_project" jdbcType="VARCHAR" property="fkTProject" />
|
||||
<result column="fk_t_user" jdbcType="VARCHAR" property="fkTUser" />
|
||||
<result column="fk_system_user" jdbcType="VARCHAR" property="fkSystemUser" />
|
||||
<result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
|
||||
<result column="user_login_name" jdbcType="VARCHAR" property="userLoginName" />
|
||||
<result column="user_real_name" jdbcType="VARCHAR" property="userRealName" />
|
||||
<result column="user_phone" jdbcType="VARCHAR" property="userPhone" />
|
||||
<result column="loan_time" jdbcType="TIMESTAMP" property="loanTime" />
|
||||
<result column="project_period" jdbcType="VARCHAR" property="projectPeriod" />
|
||||
<result column="first_price_loan" jdbcType="DECIMAL" property="firstPriceLoan" />
|
||||
<result column="repayment_date" jdbcType="TIMESTAMP" property="repaymentDate" />
|
||||
<result column="overdue_day_count" jdbcType="SMALLINT" property="overdueDayCount" />
|
||||
<result column="fk_t_biz_collection_overdue_bucket_interval_id" jdbcType="SMALLINT" property="fkTBizCollectionOverdueBucketIntervalId" />
|
||||
<result column="collector_login_name" jdbcType="VARCHAR" property="collectorLoginName" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="state" jdbcType="TINYINT" property="state" />
|
||||
<result column="full_repay_date" jdbcType="TIMESTAMP" property="fullRepayDate" />
|
||||
<result column="last_collection_time" jdbcType="TIMESTAMP" property="lastCollectionTime" />
|
||||
<result column="next_collection_time" jdbcType="TIMESTAMP" property="nextCollectionTime" />
|
||||
<result column="histry_collection_count" jdbcType="SMALLINT" property="histryCollectionCount" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryAll" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
t1.id,
|
||||
t1.number project_number,
|
||||
t1.loan_time,
|
||||
t1.deadline,
|
||||
t1.unit,
|
||||
t1.first_price_loan,
|
||||
t2.repayment_date
|
||||
from t_project t1 inner join t_project_refund t2 on t1.id=t2.project_id and t1.status in ('7')
|
||||
where
|
||||
t1.loan_time > #{_parameter}
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.infincash.cron.collection.table.TBizCollectionRecord">
|
||||
insert into t_biz_collection_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="fkTProject != null">
|
||||
fk_t_project,
|
||||
</if>
|
||||
<if test="fkTUser != null">
|
||||
fk_t_user,
|
||||
</if>
|
||||
<if test="fkSystemUser != null">
|
||||
fk_system_user,
|
||||
</if>
|
||||
<if test="waitOrRecord != null">
|
||||
wait_or_record,
|
||||
</if>
|
||||
<if test="projectNumber != null">
|
||||
project_number,
|
||||
</if>
|
||||
<if test="userLoginName != null">
|
||||
user_login_name,
|
||||
</if>
|
||||
<if test="userRealName != null">
|
||||
user_real_name,
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
user_phone,
|
||||
</if>
|
||||
<if test="loanTime != null">
|
||||
loan_time,
|
||||
</if>
|
||||
<if test="projectPeriod != null">
|
||||
project_period,
|
||||
</if>
|
||||
<if test="firstPriceLoan != null">
|
||||
first_price_loan,
|
||||
</if>
|
||||
<if test="repaymentDate != null">
|
||||
repayment_date,
|
||||
</if>
|
||||
<if test="overdueDayCount != null">
|
||||
overdue_day_count,
|
||||
</if>
|
||||
<if test="fkTBizCollectionOverdueBucketIntervalId != null">
|
||||
fk_t_biz_collection_overdue_bucket_interval_id,
|
||||
</if>
|
||||
<if test="collectorLoginName != null">
|
||||
collector_login_name,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state,
|
||||
</if>
|
||||
<if test="fullRepayDate != null">
|
||||
full_repay_date,
|
||||
</if>
|
||||
<if test="lastCollectionTime != null">
|
||||
last_collection_time,
|
||||
</if>
|
||||
<if test="nextCollectionTime != null">
|
||||
next_collection_time,
|
||||
</if>
|
||||
<if test="histryCollectionCount != null">
|
||||
histry_collection_count,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="fkTProject != null">
|
||||
#{fkTProject,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="fkTUser != null">
|
||||
#{fkTUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="fkSystemUser != null">
|
||||
#{fkSystemUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="waitOrRecord != null">
|
||||
#{waitOrRecord,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="projectNumber != null">
|
||||
#{projectNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userLoginName != null">
|
||||
#{userLoginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRealName != null">
|
||||
#{userRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
#{userPhone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loanTime != null">
|
||||
#{loanTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="projectPeriod != null">
|
||||
#{projectPeriod,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="firstPriceLoan != null">
|
||||
#{firstPriceLoan,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="repaymentDate != null">
|
||||
#{repaymentDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="overdueDayCount != null">
|
||||
#{overdueDayCount,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="fkTBizCollectionOverdueBucketIntervalId != null">
|
||||
#{fkTBizCollectionOverdueBucketIntervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="collectorLoginName != null">
|
||||
#{collectorLoginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
#{state,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="fullRepayDate != null">
|
||||
#{fullRepayDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="lastCollectionTime != null">
|
||||
#{lastCollectionTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="nextCollectionTime != null">
|
||||
#{nextCollectionTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="histryCollectionCount != null">
|
||||
#{histryCollectionCount,jdbcType=SMALLINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.infincash.cron.collection.table.TBizCollectionRecord">
|
||||
update t_biz_collection_record
|
||||
<set>
|
||||
<if test="fkTProject != null">
|
||||
fk_t_project = #{fkTProject,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="fkTUser != null">
|
||||
fk_t_user = #{fkTUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="fkSystemUser != null">
|
||||
fk_system_user = #{fkSystemUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="waitOrRecord != null">
|
||||
wait_or_record = #{waitOrRecord,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="projectNumber != null">
|
||||
project_number = #{projectNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userLoginName != null">
|
||||
user_login_name = #{userLoginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRealName != null">
|
||||
user_real_name = #{userRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userPhone != null">
|
||||
user_phone = #{userPhone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loanTime != null">
|
||||
loan_time = #{loanTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="projectPeriod != null">
|
||||
project_period = #{projectPeriod,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="firstPriceLoan != null">
|
||||
first_price_loan = #{firstPriceLoan,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="repaymentDate != null">
|
||||
repayment_date = #{repaymentDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="overdueDayCount != null">
|
||||
overdue_day_count = #{overdueDayCount,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="fkTBizCollectionOverdueBucketIntervalId != null">
|
||||
fk_t_biz_collection_overdue_bucket_interval_id = #{fkTBizCollectionOverdueBucketIntervalId,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="collectorLoginName != null">
|
||||
collector_login_name = #{collectorLoginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state = #{state,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="fullRepayDate != null">
|
||||
full_repay_date = #{fullRepayDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="lastCollectionTime != null">
|
||||
last_collection_time = #{lastCollectionTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="nextCollectionTime != null">
|
||||
next_collection_time = #{nextCollectionTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="histryCollectionCount != null">
|
||||
histry_collection_count = #{histryCollectionCount,jdbcType=SMALLINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in new issue