170 lines
9.4 KiB
XML
170 lines
9.4 KiB
XML
|
<?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.ruoyi.system.mapper.TMemberWalletLogMapper">
|
||
|
|
||
|
<resultMap type="com.ruoyi.system.domain.TMemberWalletLog" id="TMemberWalletLogResult">
|
||
|
<result property="id" column="id" />
|
||
|
<result property="createTime" column="create_time" />
|
||
|
<result property="updateTime" column="update_time" />
|
||
|
<result property="memberId" column="member_id" />
|
||
|
<result property="walletId" column="wallet_id" />
|
||
|
<result property="type" column="type" />
|
||
|
<result property="coinId" column="coin_id" />
|
||
|
<result property="opType" column="op_type" />
|
||
|
<result property="opRemark" column="op_remark" />
|
||
|
<result property="opValue" column="op_value" />
|
||
|
<result property="opBefore" column="op_before" />
|
||
|
<result property="opAfter" column="op_after" />
|
||
|
<result property="extRemark" column="ext_remark" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectTMemberWalletLogVo">
|
||
|
select id, create_time, update_time, flag, member_id, wallet_id, type, coin_id, op_type, op_remark, op_value, op_before, op_after, ext_remark from t_member_wallet_log
|
||
|
</sql>
|
||
|
|
||
|
<select id="findTMemberWalletLogList" parameterType="com.ruoyi.system.domain.TMemberWalletLog" resultMap="TMemberWalletLogResult">
|
||
|
select tmwl.*,tm.account,tm.uid from t_member_wallet_log
|
||
|
tmwl LEFT JOIN t_member tm ON tmwl.member_id=tm.id
|
||
|
<where>
|
||
|
tmwl.op_type in (4,5,6,7,8,9,10)
|
||
|
<if test="id != null "> and tmwl.id = #{id}</if>
|
||
|
<if test="account != null and account != ''"> and tm.account = #{account}</if>
|
||
|
<if test="uid != null and uid != ''"> and tm.uid = #{uid}</if>
|
||
|
<if test="memberId != null "> and tmwl.member_id = #{memberId}</if>
|
||
|
<if test="walletId != null "> and tmwl.wallet_id = #{walletId}</if>
|
||
|
<if test="type != null "> and tmwl.type = #{type}</if>
|
||
|
<if test="coinId != null "> and tmwl.coin_id = #{coinId}</if>
|
||
|
<if test="opType != null "> and tmwl.op_type = #{opType}</if>
|
||
|
<if test="opRemark != null and opRemark != ''"> and tmwl.op_remark = #{opRemark}</if>
|
||
|
<if test="account != null and account != ''"> and tm.account = #{account}</if>
|
||
|
<if test="uid != null and uid != ''"> and tm.uid = #{uid}</if>
|
||
|
<if test="opValue != null "> and tmwl.op_value = #{opValue}</if>
|
||
|
<if test="opBefore != null "> and tmwl.op_before = #{opBefore}</if>
|
||
|
<if test="opAfter != null "> and tmwl.op_after = #{opAfter}</if>
|
||
|
<if test="extRemark != null and extRemark != ''"> and tmwl.ext_remark = #{extRemark}</if>
|
||
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and tmwl.create_time between #{params.beginTime} and #{params.endTime}</if>
|
||
|
</where>
|
||
|
order by tmwl.id desc
|
||
|
</select>
|
||
|
|
||
|
<select id="selectTMemberWalletLogList" parameterType="com.ruoyi.system.domain.TMemberWalletLog" resultMap="TMemberWalletLogResult">
|
||
|
<include refid="selectTMemberWalletLogVo"/>
|
||
|
<where>
|
||
|
<if test="id != null "> and id = #{id}</if>
|
||
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||
|
<if test="walletId != null "> and wallet_id = #{walletId}</if>
|
||
|
<if test="type != null "> and type = #{type}</if>
|
||
|
<if test="coinId != null "> and coin_id = #{coinId}</if>
|
||
|
<if test="opType != null "> and op_type = #{opType}</if>
|
||
|
<if test="opRemark != null and opRemark != ''"> and op_remark = #{opRemark}</if>
|
||
|
<if test="opValue != null "> and op_value = #{opValue}</if>
|
||
|
<if test="opBefore != null "> and op_before = #{opBefore}</if>
|
||
|
<if test="opAfter != null "> and op_after = #{opAfter}</if>
|
||
|
<if test="extRemark != null and extRemark != ''"> and ext_remark = #{extRemark}</if>
|
||
|
<if test="types != null">
|
||
|
<if test="types == 1">
|
||
|
and op_type in (12)
|
||
|
</if>
|
||
|
<if test="types == 2">
|
||
|
and op_type in (4,6,8)
|
||
|
</if>
|
||
|
<if test="types == 3">
|
||
|
and op_type in (10,11)
|
||
|
</if>
|
||
|
<if test="types == 4">
|
||
|
and op_type in (5,7,9)
|
||
|
</if>
|
||
|
</if>
|
||
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and create_time between #{params.beginTime} and #{params.endTime}</if>
|
||
|
</where>
|
||
|
order by id desc
|
||
|
</select>
|
||
|
|
||
|
<select id="findTMemberWalletLog" parameterType="com.ruoyi.system.domain.TMemberWalletLog" resultMap="TMemberWalletLogResult">
|
||
|
<include refid="selectTMemberWalletLogVo"/>
|
||
|
<where>
|
||
|
<if test="id != null "> and id = #{id}</if>
|
||
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||
|
<if test="walletId != null "> and wallet_id = #{walletId}</if>
|
||
|
<if test="type != null "> and type = #{type}</if>
|
||
|
<if test="coinId != null "> and coin_id = #{coinId}</if>
|
||
|
<if test="opType != null "> and op_type = #{opType}</if>
|
||
|
<if test="opRemark != null and opRemark != ''"> and op_remark = #{opRemark}</if>
|
||
|
<if test="opValue != null "> and op_value = #{opValue}</if>
|
||
|
<if test="opBefore != null "> and op_before = #{opBefore}</if>
|
||
|
<if test="opAfter != null "> and op_after = #{opAfter}</if>
|
||
|
<if test="extRemark != null and extRemark != ''"> and ext_remark = #{extRemark}</if>
|
||
|
</where>
|
||
|
limit 1
|
||
|
</select>
|
||
|
|
||
|
<select id="selectTMemberWalletLogById" parameterType="Integer" resultMap="TMemberWalletLogResult">
|
||
|
<include refid="selectTMemberWalletLogVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertTMemberWalletLog" parameterType="com.ruoyi.system.domain.TMemberWalletLog" useGeneratedKeys="true" keyProperty="id">
|
||
|
insert into t_member_wallet_log
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="createTime != null">create_time,</if>
|
||
|
<if test="updateTime != null">update_time,</if>
|
||
|
<if test="flag != null and flag != ''">flag,</if>
|
||
|
<if test="memberId != null">member_id,</if>
|
||
|
<if test="walletId != null">wallet_id,</if>
|
||
|
<if test="type != null">type,</if>
|
||
|
<if test="coinId != null">coin_id,</if>
|
||
|
<if test="opType != null">op_type,</if>
|
||
|
<if test="opRemark != null and opRemark != ''">op_remark,</if>
|
||
|
<if test="opValue != null">op_value,</if>
|
||
|
<if test="opBefore != null">op_before,</if>
|
||
|
<if test="opAfter != null">op_after,</if>
|
||
|
<if test="extRemark != null and extRemark != ''">ext_remark,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="createTime != null">#{createTime},</if>
|
||
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
<if test="flag != null and flag != ''">#{flag},</if>
|
||
|
<if test="memberId != null">#{memberId},</if>
|
||
|
<if test="walletId != null">#{walletId},</if>
|
||
|
<if test="type != null">#{type},</if>
|
||
|
<if test="coinId != null">#{coinId},</if>
|
||
|
<if test="opType != null">#{opType},</if>
|
||
|
<if test="opRemark != null and opRemark != ''">#{opRemark},</if>
|
||
|
<if test="opValue != null">#{opValue},</if>
|
||
|
<if test="opBefore != null">#{opBefore},</if>
|
||
|
<if test="opAfter != null">#{opAfter},</if>
|
||
|
<if test="extRemark != null and extRemark != ''">#{extRemark},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateTMemberWalletLog" parameterType="com.ruoyi.system.domain.TMemberWalletLog">
|
||
|
update t_member_wallet_log
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
<if test="flag != null and flag != ''">flag = #{flag},</if>
|
||
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||
|
<if test="walletId != null">wallet_id = #{walletId},</if>
|
||
|
<if test="type != null">type = #{type},</if>
|
||
|
<if test="coinId != null">coin_id = #{coinId},</if>
|
||
|
<if test="opType != null">op_type = #{opType},</if>
|
||
|
<if test="opRemark != null and opRemark != ''">op_remark = #{opRemark},</if>
|
||
|
<if test="opValue != null">op_value = #{opValue},</if>
|
||
|
<if test="opBefore != null">op_before = #{opBefore},</if>
|
||
|
<if test="opAfter != null">op_after = #{opAfter},</if>
|
||
|
<if test="extRemark != null and extRemark != ''">ext_remark = #{extRemark},</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteTMemberWalletLogByIds" parameterType="String">
|
||
|
delete from t_member_wallet_log where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|