98 lines
4.7 KiB
XML
98 lines
4.7 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.TMemberWalletMapper">
|
|
|
|
<resultMap type="com.ruoyi.system.domain.TMemberWallet" id="TMemberWalletResult">
|
|
<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="coinId" column="coin_id" />
|
|
<result property="balance" column="balance" />
|
|
<result property="frozen" column="frozen" />
|
|
</resultMap>
|
|
|
|
<sql id="selectTMemberWalletVo">
|
|
select id, create_time, update_time, flag, member_id, coin_id, balance, frozen from t_member_wallet
|
|
</sql>
|
|
|
|
<select id="selectTMemberWalletList" parameterType="com.ruoyi.system.domain.TMemberWallet" resultMap="TMemberWalletResult">
|
|
select tmw.*,tm.account,tm.uid from t_member_wallet tmw LEFT JOIN
|
|
t_member tm ON tmw.member_id=tm.id
|
|
<where>
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="memberId != null "> and member_id = #{memberId}</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="coinId != null "> and coin_id = #{coinId}</if>
|
|
<if test="balance != null "> and balance = #{balance}</if>
|
|
<if test="frozen != null "> and frozen = #{frozen}</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="findTMemberWallet" parameterType="com.ruoyi.system.domain.TMemberWallet" resultMap="TMemberWalletResult">
|
|
<include refid="selectTMemberWalletVo"/>
|
|
<where>
|
|
<if test="id != null "> and id = #{id}</if>
|
|
|
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
|
<if test="coinId != null "> and coin_id = #{coinId}</if>
|
|
<if test="balance != null "> and balance = #{balance}</if>
|
|
<if test="frozen != null "> and frozen = #{frozen}</if>
|
|
</where>
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectTMemberWalletById" parameterType="Integer" resultMap="TMemberWalletResult">
|
|
<include refid="selectTMemberWalletVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertTMemberWallet" parameterType="com.ruoyi.system.domain.TMemberWallet" useGeneratedKeys="true" keyProperty="id">
|
|
insert into t_member_wallet
|
|
<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="coinId != null">coin_id,</if>
|
|
<if test="balance != null">balance,</if>
|
|
<if test="frozen != null">frozen,</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="coinId != null">#{coinId},</if>
|
|
<if test="balance != null">#{balance},</if>
|
|
<if test="frozen != null">#{frozen},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateTMemberWallet" parameterType="com.ruoyi.system.domain.TMemberWallet">
|
|
update t_member_wallet
|
|
<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="coinId != null">coin_id = #{coinId},</if>
|
|
<if test="balance != null">balance = #{balance},</if>
|
|
<if test="frozen != null">frozen = #{frozen},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteTMemberWalletByIds" parameterType="String">
|
|
delete from t_member_wallet where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |