<?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.panzhihua.service_community.dao.VolunteerMerchantWithdrawDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.VolunteerMerchantWithdraw" id="MerchantWithdrawMap">
|
<result property="id" column="id" />
|
<result property="merchantId" column="merchant_id" />
|
<result property="creationTime" column="creation_time" />
|
<result property="updateTime" column="update_time" />
|
<result property="communityId" column="community_id" />
|
<result property="withdrawIntegral" column="withdraw_integral" />
|
<result property="disposeTime" column="dispose_time" />
|
<result property="disposeType" column="dispose_type" />
|
<result property="isDelete" column="is_delete" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="base_sql">
|
id,
|
merchant_id,
|
community_id,
|
(select vm.name from volunteer_merchant as vm where volunteer_merchant_withdraw.merchant_id=vm.id) as merchantName,
|
withdraw_integral,
|
creation_time,
|
update_time,
|
dispose_time,
|
dispose_type,
|
is_delete
|
</sql>
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="MerchantWithdrawMap">
|
select <include refid="base_sql"/>
|
from volunteer_merchant_withdraw
|
<where>
|
is_delete='0'
|
<if test="disposeType !=null and disposeType != '' ">
|
and dispose_type=#{disposeType}
|
</if>
|
<if test="merchantName !=null and merchantName != '' ">
|
and
|
((select vm.name from volunteer_merchant as vm where volunteer_merchant_withdraw.merchant_id=vm.id) like concat('%',#{merchantName},'%'))
|
</if>
|
<if test="merchantId !=null and merchantId != '' ">
|
and merchant_id=#{merchantId}
|
</if>
|
<if test="communityId !=null and communityId != '' ">
|
and community_id=#{communityId}
|
</if>
|
</where>
|
order by creation_time desc
|
</select>
|
|
<insert id="insert">
|
insert into volunteer_merchant_withdraw
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null">
|
id,
|
</if>
|
<if test="item.merchantId != null">
|
merchant_id,
|
</if>
|
<if test="item.communityId != null">
|
community_id,
|
</if>
|
<if test="item.withdrawIntegral != null">
|
withdraw_integral,
|
</if>
|
<if test="item.disposeTime != null">
|
dispose_time,
|
</if>
|
<if test="item.disposeType != null">
|
dispose_type,
|
</if>
|
<if test="item.isDelete != null">
|
is_delete,
|
</if>
|
creation_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null">
|
#{item.id},
|
</if>
|
<if test="item.merchantId != null">
|
#{item.merchantId},
|
</if>
|
<if test="item.communityId != null">
|
#{item.communityId},
|
</if>
|
<if test="item.withdrawIntegral != null">
|
#{item.withdrawIntegral},
|
</if>
|
<if test="item.disposeTime != null">
|
#{item.disposeTime},
|
</if>
|
<if test="item.disposeType != null">
|
#{item.disposeType},
|
</if>
|
<if test="item.isDelete != null">
|
#{item.isDelete},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="update">
|
update volunteer_merchant_withdraw
|
<set>
|
<if test="item.id != null">
|
id=#{item.id},
|
</if>
|
<if test="item.merchantId != null">
|
merchant_id=#{item.merchantId},
|
</if>
|
<if test="item.communityId != null">
|
community_id=#{item.communityId},
|
</if>
|
<if test="item.withdrawIntegral != null">
|
withdraw_integral=#{item.withdrawIntegral},
|
</if>
|
<if test="item.disposeTime != null">
|
dispose_time=#{item.disposeTime},
|
</if>
|
<if test="item.disposeType != null">
|
dispose_type=#{item.disposeType},
|
</if>
|
<if test="item.isDelete != null">
|
is_delete=#{item.isDelete},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<update id="delete" parameterType="String">
|
update volunteer_merchant_withdraw set is_delete=1 where id=#{id}
|
</update>
|
|
|
<update id="dispose" parameterType="String">
|
update volunteer_merchant_withdraw set dispose_time=sysdate(),dispose_type='1' where id=#{id}
|
</update>
|
|
</mapper>
|