门店钱包提现,审核
This commit is contained in:
@ -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}
|
||||
|
||||
@ -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>
|
||||
Reference in New Issue
Block a user