|
|
@@ -2,7 +2,7 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="org.jeecg.modules.hlwpayment.mapper.HlwPaymentDetailMapper">
|
|
|
|
|
|
- <sql id="hlwPaymentDetailColumns">
|
|
|
+ <sql id="hlwPaymentDetailColumns">
|
|
|
a.id AS "id",
|
|
|
a.payment_id AS "paymentId",
|
|
|
a.user_name AS "userName",
|
|
|
@@ -32,40 +32,40 @@
|
|
|
a.duty_apply_id AS "dutyApplyId"
|
|
|
</sql>
|
|
|
|
|
|
- <sql id="hlwPaymentDetailJoins">
|
|
|
+ <sql id="hlwPaymentDetailJoins">
|
|
|
|
|
|
- </sql>
|
|
|
+ </sql>
|
|
|
|
|
|
|
|
|
- <select id="get" resultType="org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail" >
|
|
|
- SELECT
|
|
|
- <include refid="hlwPaymentDetailColumns"/>
|
|
|
- FROM hlw_payment_detail a
|
|
|
- <include refid="hlwPaymentDetailJoins"/>
|
|
|
- WHERE a.id = #{id}
|
|
|
- </select>
|
|
|
+ <select id="get" resultType="org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail" >
|
|
|
+ SELECT
|
|
|
+ <include refid="hlwPaymentDetailColumns"/>
|
|
|
+ FROM hlw_payment_detail a
|
|
|
+ <include refid="hlwPaymentDetailJoins"/>
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findList" resultType="org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail" >
|
|
|
- SELECT
|
|
|
- <include refid="hlwPaymentDetailColumns"/>
|
|
|
- FROM hlw_payment_detail a
|
|
|
- <include refid="hlwPaymentDetailJoins"/>
|
|
|
- <where>
|
|
|
- ${ew.sqlSegment}
|
|
|
+ <select id="findList" resultType="org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail" >
|
|
|
+ SELECT
|
|
|
+ <include refid="hlwPaymentDetailColumns"/>
|
|
|
+ FROM hlw_payment_detail a
|
|
|
+ <include refid="hlwPaymentDetailJoins"/>
|
|
|
+ <where>
|
|
|
+ ${ew.sqlSegment}
|
|
|
<if test="hlwPaymentDetail.paymentId != null">
|
|
|
and a.payment_id = #{hlwPaymentDetail.paymentId}
|
|
|
</if>
|
|
|
- <if test="hlwPaymentDetail.status != null">
|
|
|
- and a.status = #{hlwPaymentDetail.status}
|
|
|
- </if>
|
|
|
+ <if test="hlwPaymentDetail.status != null">
|
|
|
+ and a.status = #{hlwPaymentDetail.status}
|
|
|
+ </if>
|
|
|
<if test="hlwPaymentDetail.userName != null and hlwPaymentDetail.userName != ''">
|
|
|
and a.user_name like concat('%',#{hlwPaymentDetail.userName},'%')
|
|
|
</if>
|
|
|
- </where>
|
|
|
- ORDER BY a.update_time DESC, a.id ASC
|
|
|
- </select>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.update_time DESC, a.id ASC
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="saveDetail">
|
|
|
+ <insert id="saveDetail">
|
|
|
INSERT INTO hlw_payment_detail(
|
|
|
payment_id,
|
|
|
user_name,
|
|
|
@@ -123,7 +123,7 @@
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateDetail">
|
|
|
+ <update id="updateDetail">
|
|
|
UPDATE hlw_payment_detail SET
|
|
|
payment_id = #{paymentId},
|
|
|
user_name = #{userName},
|
|
|
@@ -154,14 +154,14 @@
|
|
|
</update>
|
|
|
|
|
|
|
|
|
- <!--物理删除-->
|
|
|
- <update id="delete">
|
|
|
+ <!--物理删除-->
|
|
|
+ <update id="delete">
|
|
|
DELETE FROM hlw_payment_detail
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <!--逻辑删除-->
|
|
|
- <update id="deleteByLogic">
|
|
|
+ <!--逻辑删除-->
|
|
|
+ <update id="deleteByLogic">
|
|
|
UPDATE hlw_payment_detail SET
|
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
|
WHERE id = #{id}
|
|
|
@@ -183,35 +183,35 @@
|
|
|
t.create_time as "createTime",
|
|
|
t.subcontractor_id as "subcontractorId"
|
|
|
from (
|
|
|
- SELECT
|
|
|
- a.id ,
|
|
|
- a.phone ,
|
|
|
- a.user_name,
|
|
|
- a.idcard_number,
|
|
|
- a.net_payment,
|
|
|
- a.tax_fee,
|
|
|
- a.create_time,
|
|
|
- hp.subcontractor_id
|
|
|
- FROM hlw_payment_detail a
|
|
|
- left join hlw_payment hp on hp.id=a.payment_id
|
|
|
- <where>
|
|
|
- ${ew.sqlSegment}
|
|
|
- and a.status=3
|
|
|
- <if test="hlwPaymentDetail.subcontractorId != null and hlwPaymentDetail.subcontractorId !=''">
|
|
|
- and hp.subcontractor_id = #{hlwPaymentDetail.subcontractorId}
|
|
|
- </if>
|
|
|
- <if test="hlwPaymentDetail.userName != null and hlwPaymentDetail.userName != ''">
|
|
|
- AND a.user_name LIKE concat('%',#{hlwPaymentDetail.userName},'%')
|
|
|
- </if>
|
|
|
- <if test="hlwPaymentDetail.idcardNumber != null and hlwPaymentDetail.idcardNumber != ''">
|
|
|
- AND a.idcard_number LIKE concat('%',#{hlwPaymentDetail.idcardNumber},'%')
|
|
|
- </if>
|
|
|
- <if test="hlwPaymentDetail.paymentResultTime_begin != null and hlwPaymentDetail.paymentResultTime_begin !=''">
|
|
|
- and a.payment_result_time between #{hlwPaymentDetail.paymentResultTime_begin} and #{hlwPaymentDetail.paymentResultTime_end}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by a.create_time desc,a.id asc
|
|
|
- ) t
|
|
|
+ SELECT
|
|
|
+ a.id ,
|
|
|
+ a.phone ,
|
|
|
+ a.user_name,
|
|
|
+ a.idcard_number,
|
|
|
+ a.net_payment,
|
|
|
+ a.tax_fee,
|
|
|
+ a.create_time,
|
|
|
+ hp.subcontractor_id
|
|
|
+ FROM hlw_payment_detail a
|
|
|
+ left join hlw_payment hp on hp.id=a.payment_id
|
|
|
+ <where>
|
|
|
+ ${ew.sqlSegment}
|
|
|
+ and a.status=3
|
|
|
+ <if test="hlwPaymentDetail.subcontractorId != null and hlwPaymentDetail.subcontractorId !=''">
|
|
|
+ and hp.subcontractor_id = #{hlwPaymentDetail.subcontractorId}
|
|
|
+ </if>
|
|
|
+ <if test="hlwPaymentDetail.userName != null and hlwPaymentDetail.userName != ''">
|
|
|
+ AND a.user_name LIKE concat('%',#{hlwPaymentDetail.userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="hlwPaymentDetail.idcardNumber != null and hlwPaymentDetail.idcardNumber != ''">
|
|
|
+ AND a.idcard_number LIKE concat('%',#{hlwPaymentDetail.idcardNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="hlwPaymentDetail.paymentResultTime_begin != null and hlwPaymentDetail.paymentResultTime_begin !=''">
|
|
|
+ and a.payment_result_time between #{hlwPaymentDetail.paymentResultTime_begin} and #{hlwPaymentDetail.paymentResultTime_end}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by a.create_time desc,a.id asc
|
|
|
+ ) t
|
|
|
group by idcardNumber
|
|
|
<if test="hlwPaymentDetail.column == null">
|
|
|
ORDER BY personalNetPayment DESC, paymentNumber DESC
|
|
|
@@ -306,7 +306,10 @@
|
|
|
hus.work_contract as "workContract",
|
|
|
has.file_path_prefix as "filePathPrefix",
|
|
|
a.order_id as "orderId",
|
|
|
- hu.user_code as "userCode"
|
|
|
+ hu.user_code as "userCode",
|
|
|
+ a.user_name as "userName",
|
|
|
+ a.phone as "phone",
|
|
|
+ a.idcard_number as "idcardNumber"
|
|
|
FROM hlw_payment_detail a
|
|
|
left join hlw_payment hp on hp.id=a.payment_id
|
|
|
left join hlw_subcontractor_account_flow haf on haf.payment_id=a.id and haf.type=0
|
|
|
@@ -329,21 +332,24 @@
|
|
|
<if test="hlwPaymentDetail.paymentResultTime_begin != null and hlwPaymentDetail.paymentResultTime_begin !=''">
|
|
|
and a.payment_result_time between #{hlwPaymentDetail.paymentResultTime_begin} and #{hlwPaymentDetail.paymentResultTime_end}
|
|
|
</if>
|
|
|
+ <if test="hlwPaymentDetail.paymentResultTime_end != null and hlwPaymentDetail.paymentResultTime_end !=''">
|
|
|
+ and to_days(a.payment_result_time) =to_days(#{hlwPaymentDetail.paymentResultTime_end})
|
|
|
+ </if>
|
|
|
</where>
|
|
|
group by a.id
|
|
|
ORDER BY a.update_time DESC, a.id asc
|
|
|
</select>
|
|
|
|
|
|
- <select id="getCountForUserPaying" resultType="int">
|
|
|
- select count(a.id)
|
|
|
- from hlw_payment_detail a
|
|
|
- LEFT JOIN hlw_payment hp on hp.id = a.payment_id
|
|
|
- <where>
|
|
|
- a.status = 2
|
|
|
- and a.idcard_number = #{hlwPaymentDetail.idcardNumber}
|
|
|
- and hp.subcontractor_id = #{hlwPaymentDetail.subcontractorId}
|
|
|
- </where>
|
|
|
- </select>
|
|
|
+ <select id="getCountForUserPaying" resultType="int">
|
|
|
+ select count(a.id)
|
|
|
+ from hlw_payment_detail a
|
|
|
+ LEFT JOIN hlw_payment hp on hp.id = a.payment_id
|
|
|
+ <where>
|
|
|
+ a.status = 2
|
|
|
+ and a.idcard_number = #{hlwPaymentDetail.idcardNumber}
|
|
|
+ and hp.subcontractor_id = #{hlwPaymentDetail.subcontractorId}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
<!--该付款明细用户本月累计已打款-->
|
|
|
<select id="findMonthListByUserId" resultType="org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail">
|
|
|
@@ -375,7 +381,7 @@
|
|
|
|
|
|
<update id="updateBatch">
|
|
|
UPDATE hlw_payment_detail SET
|
|
|
- status = 0
|
|
|
+ status = 0
|
|
|
WHERE id in
|
|
|
<foreach collection ="list" item="item" open="(" close=")" separator =",">
|
|
|
#{item.id}
|