alive-admin/alive-server/target/classes/mapper/system/PayCoinLogMapper.xml

133 lines
7.3 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.PayCoinLogMapper">
<resultMap type="com.ruoyi.system.domain.PayCoinLog" id="PayCoinLogResult">
<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="address" column="address" />
<result property="coinId" column="coin_id" />
<result property="coinName" column="coin_name" />
<result property="payUsdt" column="pay_usdt" />
<result property="amount" column="amount" />
<result property="unitPrice" column="unit_price" />
<result property="status" column="status" />
<result property="hash" column="hash" />
<result property="orderNumber" column="order_number" />
<result property="illustrate" column="illustrate" />
</resultMap>
<sql id="selectPayCoinLogVo">
select id, create_time, update_time, member_id, address, coin_id, coin_name, pay_usdt, amount, unit_price, status, hash, order_number, illustrate from pay_coin_log
</sql>
<select id="selectPayCoinLogList" parameterType="com.ruoyi.system.domain.PayCoinLog" resultMap="PayCoinLogResult">
<include refid="selectPayCoinLogVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="memberId != null "> and member_id = #{memberId}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="coinId != null "> and coin_id = #{coinId}</if>
<if test="coinName != null and coinName != ''"> and coin_name like concat('%', #{coinName}, '%')</if>
<if test="payUsdt != null "> and pay_usdt = #{payUsdt}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
<if test="status != null "> and status = #{status}</if>
<if test="hash != null and hash != ''"> and hash = #{hash}</if>
<if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
<if test="illustrate != null and illustrate != ''"> and illustrate = #{illustrate}</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="findPayCoinLog" parameterType="com.ruoyi.system.domain.PayCoinLog" resultMap="PayCoinLogResult">
<include refid="selectPayCoinLogVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="memberId != null "> and member_id = #{memberId}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="coinId != null "> and coin_id = #{coinId}</if>
<if test="coinName != null and coinName != ''"> and coin_name like concat('%', #{coinName}, '%')</if>
<if test="payUsdt != null "> and pay_usdt = #{payUsdt}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
<if test="status != null "> and status = #{status}</if>
<if test="hash != null and hash != ''"> and hash = #{hash}</if>
<if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
<if test="illustrate != null and illustrate != ''"> and illustrate = #{illustrate}</if>
</where>
limit 1
</select>
<select id="selectPayCoinLogById" parameterType="Integer" resultMap="PayCoinLogResult">
<include refid="selectPayCoinLogVo"/>
where id = #{id}
</select>
<insert id="insertPayCoinLog" parameterType="com.ruoyi.system.domain.PayCoinLog" useGeneratedKeys="true" keyProperty="id">
insert into pay_coin_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="memberId != null">member_id,</if>
<if test="address != null">address,</if>
<if test="coinId != null">coin_id,</if>
<if test="coinName != null and coinName != ''">coin_name,</if>
<if test="payUsdt != null">pay_usdt,</if>
<if test="amount != null">amount,</if>
<if test="unitPrice != null">unit_price,</if>
<if test="status != null">status,</if>
<if test="hash != null">hash,</if>
<if test="orderNumber != null and orderNumber != ''">order_number,</if>
<if test="illustrate != null">illustrate,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="memberId != null">#{memberId},</if>
<if test="address != null">#{address},</if>
<if test="coinId != null">#{coinId},</if>
<if test="coinName != null and coinName != ''">#{coinName},</if>
<if test="payUsdt != null">#{payUsdt},</if>
<if test="amount != null">#{amount},</if>
<if test="unitPrice != null">#{unitPrice},</if>
<if test="status != null">#{status},</if>
<if test="hash != null">#{hash},</if>
<if test="orderNumber != null and orderNumber != ''">#{orderNumber},</if>
<if test="illustrate != null">#{illustrate},</if>
</trim>
</insert>
<update id="updatePayCoinLog" parameterType="com.ruoyi.system.domain.PayCoinLog">
update pay_coin_log
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="memberId != null">member_id = #{memberId},</if>
<if test="address != null">address = #{address},</if>
<if test="coinId != null">coin_id = #{coinId},</if>
<if test="coinName != null and coinName != ''">coin_name = #{coinName},</if>
<if test="payUsdt != null">pay_usdt = #{payUsdt},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
<if test="status != null">status = #{status},</if>
<if test="hash != null">hash = #{hash},</if>
<if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
<if test="illustrate != null">illustrate = #{illustrate},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePayCoinLogByIds" parameterType="String">
delete from pay_coin_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>