门店钱包提现,审核

This commit is contained in:
19173159168
2025-08-24 15:09:12 +08:00
parent 2faf33fcde
commit 6bd15e4627
22 changed files with 470 additions and 68 deletions

View File

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="changeType" column="change_type" />
<result property="changeStatus" column="change_status" />
<result property="payType" column="pay_type" />
<result property="changeTime" column="change_time" />
<result property="changeAmount" column="change_amount" />
@ -16,31 +17,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="userName" column="userName" />
<association property="companyStore" javaType="CompanyStore">
<result property="id" column="store_id" />
<result property="name" column="store_name" />
<result property="contactPerson" column="store_contact_person" />
<result property="phone" column="store_phone" />
<result property="operatingNature" column="store_operating_nature" />
<result property="zucheRatio" column="store_zuche_ratio" />
<result property="zudianRatio" column="store_zudian_ratio" />
<result property="daishouRatio" column="store_daishou_ratio" />
<result property="storeNumber" column="store_store_number" />
</association>
</resultMap>
<sql id="selectZcBaseWalletChangeVo">
select id, user_id, change_type, pay_type, change_time, change_amount, referral_order_no, del_flag, create_time, update_time from zc_base_wallet_change
select a.id, a.user_id, a.change_type, a.change_status, a.pay_type, a.change_time, a.change_amount, a.referral_order_no, a.del_flag, a.create_time, a.update_time,
s.id as store_id,
s.name as store_name,
s.contact_person as store_contact_person,
s.phone as store_phone,
s.operating_nature as store_operating_nature,
s.zuche_ratio as store_zuche_ratio,
s.zudian_ratio as store_zudian_ratio,
s.daishou_ratio as store_daishou_ratio,
s.store_number as store_store_number
from zc_base_wallet_change a
left join zc_company_store s on a.user_id = s.id
</sql>
<select id="selectZcBaseWalletChangeList" parameterType="ZcBaseWalletChange" resultMap="ZcBaseWalletChangeResult">
select a.id, a.user_id, a.change_type, a.pay_type, a.change_time, a.change_amount, a.referral_order_no, a.del_flag, a.create_time, a.update_time,
b.user_name as userName
from zc_base_wallet_change a
left join zc_base_user b on a.user_id = b.id
<include refid="selectZcBaseWalletChangeVo"/>
<where>
<if test="userId != null "> and a.user_id = #{userId}</if>
<if test="changeType != null and changeType != ''"> and a.change_type = #{changeType}</if>
<if test="changeStatus != null and changeStatus != ''"> and a.change_status = #{changeStatus}</if>
<if test="payType != null and payType != ''"> and a.pay_type = #{payType}</if>
<if test="changeTime != null "> and a.change_time = #{changeTime}</if>
<if test="changeAmount != null "> and a.change_amount = #{changeAmount}</if>
<if test="referralOrderNo != null and referralOrderNo != ''"> and a.referral_order_no = #{referralOrderNo}</if>
<if test="userName != null and userName != ''"> and b.user_name = #{userName}</if>
<if test="userName != null and userName != ''"> and s.name = #{userName}</if>
</where>
order by a.update_time desc
</select>
<select id="selectZcBaseWalletChangeById" parameterType="Long" resultMap="ZcBaseWalletChangeResult">
<include refid="selectZcBaseWalletChangeVo"/>
where id = #{id}
where a.id = #{id}
</select>
<insert id="insertZcBaseWalletChange" parameterType="ZcBaseWalletChange" useGeneratedKeys="true" keyProperty="id">
@ -74,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="changeType != null and changeType != ''">change_type = #{changeType},</if>
<if test="changeStatus != null and changeStatus != ''">change_status = #{changeStatus},</if>
<if test="payType != null and payType != ''">pay_type = #{payType},</if>
<if test="changeTime != null">change_time = #{changeTime},</if>
<if test="changeAmount != null">change_amount = #{changeAmount},</if>
@ -84,6 +108,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="review">
update zc_base_wallet_change
<set>
<if test="changeStatus != null and changeStatus != ''">change_status = #{changeStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</set>
where id = #{id}
</update>
<delete id="deleteZcBaseWalletChangeById" parameterType="Long">
delete from zc_base_wallet_change where id = #{id}

View File

@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="sub_id" />
<result property="userId" column="sub_user_id" />
<result property="changeType" column="sub_change_type" />
<result property="changeStatus" column="sub_change_status" />
<result property="payType" column="sub_pay_type" />
<result property="changeTime" column="sub_change_time" />
<result property="changeAmount" column="sub_change_amount" />
@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectZcBaseWalletByUserId" parameterType="Long" resultMap="ZcBaseWalletZcBaseWalletChangeResult">
select a.user_id, a.user_name, a.phone_number, a.balance, a.available_amount, a.freeze_amount, a.del_flag, a.create_time, a.update_time,
b.id as sub_id, b.user_id as sub_user_id, b.change_type as sub_change_type, b.pay_type as sub_pay_type, b.change_time as sub_change_time, b.change_amount as sub_change_amount, b.referral_order_no as sub_referral_order_no, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
b.id as sub_id, b.user_id as sub_user_id, b.change_type as sub_change_type, b.change_status as sub_change_status, b.pay_type as sub_pay_type, b.change_time as sub_change_time, b.change_amount as sub_change_amount, b.referral_order_no as sub_referral_order_no, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
from zc_base_wallet a
left join zc_base_wallet_change b on b.user_id = a.user_id
where a.user_id = #{userId}
@ -124,4 +125,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<!-- 减少钱包金额 -->
<update id="reduceWalletAmount">
UPDATE zc_base_wallet
SET
available_amount = available_amount - #{amount},
balance = balance - #{amount},
update_time = NOW()
WHERE user_id = #{userId}
AND available_amount >= #{amount}
AND balance >= #{amount}
</update>
</mapper>

View File

@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="operatorName" column="operator_name" />
<result property="storeName" column="store_name" />
<result property="licensePlate" column="license_plate" />
<result property="distribed" column="distribed" />
</resultMap>
<resultMap id="ZcOrderMainZcOrderSubResult" type="ZcOrderMain" extends="ZcOrderMainResult">
@ -87,11 +88,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectZcOrderMainVo">
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, del_flag, create_time, update_time from zc_order_main
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, distribed, del_flag, create_time, update_time from zc_order_main
</sql>
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time,a.distribed, a.del_flag, a.create_time, a.update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
from zc_order_main a
left join zc_company c on c.id = a.operator_id
@ -133,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.pay_status as sub_pay_status,b.transaction_id as sub_transaction_id, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
@ -147,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectZcOrderMainImgByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderCarImgResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
from zc_order_main a