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

115 lines
6.4 KiB
XML
Raw Permalink Normal View History

2024-05-27 16:26:14 +08:00
<?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.CoinConfigMapper">
<resultMap type="com.ruoyi.system.domain.CoinConfig" id="CoinConfigResult">
<result property="id" column="id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="coinName" column="coin_name" />
<result property="state" column="state" />
<result property="usdtPrice" column="usdt_price" />
<result property="minNumber" column="min_number" />
<result property="maxNumber" column="max_number" />
<result property="airdropNumber" column="airdrop_number" />
<result property="privatePlacement" column="private_placement" />
<result property="toPrivatePlacement" column="to_private_placement" />
</resultMap>
<sql id="selectCoinConfigVo">
select id, create_time, update_time, coin_name, state, usdt_price, min_number, max_number, airdrop_number, private_placement, to_private_placement from coin_config
</sql>
<select id="selectCoinConfigList" parameterType="com.ruoyi.system.domain.CoinConfig" resultMap="CoinConfigResult">
<include refid="selectCoinConfigVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="coinName != null and coinName != ''"> and coin_name like concat('%', #{coinName}, '%')</if>
<if test="state != null "> and state = #{state}</if>
<if test="usdtPrice != null "> and usdt_price = #{usdtPrice}</if>
<if test="minNumber != null "> and min_number = #{minNumber}</if>
<if test="maxNumber != null "> and max_number = #{maxNumber}</if>
<if test="airdropNumber != null "> and airdrop_number = #{airdropNumber}</if>
<if test="privatePlacement != null "> and private_placement = #{privatePlacement}</if>
<if test="toPrivatePlacement != null "> and to_private_placement = #{toPrivatePlacement}</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="findCoinConfig" parameterType="com.ruoyi.system.domain.CoinConfig" resultMap="CoinConfigResult">
<include refid="selectCoinConfigVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="coinName != null and coinName != ''"> and coin_name like concat('%', #{coinName}, '%')</if>
<if test="state != null "> and state = #{state}</if>
<if test="usdtPrice != null "> and usdt_price = #{usdtPrice}</if>
<if test="minNumber != null "> and min_number = #{minNumber}</if>
<if test="maxNumber != null "> and max_number = #{maxNumber}</if>
<if test="airdropNumber != null "> and airdrop_number = #{airdropNumber}</if>
<if test="privatePlacement != null "> and private_placement = #{privatePlacement}</if>
<if test="toPrivatePlacement != null "> and to_private_placement = #{toPrivatePlacement}</if>
</where>
limit 1
</select>
<select id="selectCoinConfigById" parameterType="Integer" resultMap="CoinConfigResult">
<include refid="selectCoinConfigVo"/>
where id = #{id}
</select>
<insert id="insertCoinConfig" parameterType="com.ruoyi.system.domain.CoinConfig" useGeneratedKeys="true" keyProperty="id">
insert into coin_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="coinName != null and coinName != ''">coin_name,</if>
<if test="state != null">state,</if>
<if test="usdtPrice != null">usdt_price,</if>
<if test="minNumber != null">min_number,</if>
<if test="maxNumber != null">max_number,</if>
<if test="airdropNumber != null">airdrop_number,</if>
<if test="privatePlacement != null">private_placement,</if>
<if test="toPrivatePlacement != null">to_private_placement,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="coinName != null and coinName != ''">#{coinName},</if>
<if test="state != null">#{state},</if>
<if test="usdtPrice != null">#{usdtPrice},</if>
<if test="minNumber != null">#{minNumber},</if>
<if test="maxNumber != null">#{maxNumber},</if>
<if test="airdropNumber != null">#{airdropNumber},</if>
<if test="privatePlacement != null">#{privatePlacement},</if>
<if test="toPrivatePlacement != null">#{toPrivatePlacement},</if>
</trim>
</insert>
<update id="updateCoinConfig" parameterType="com.ruoyi.system.domain.CoinConfig">
update coin_config
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="coinName != null and coinName != ''">coin_name = #{coinName},</if>
<if test="state != null">state = #{state},</if>
<if test="usdtPrice != null">usdt_price = #{usdtPrice},</if>
<if test="minNumber != null">min_number = #{minNumber},</if>
<if test="maxNumber != null">max_number = #{maxNumber},</if>
<if test="airdropNumber != null">airdrop_number = #{airdropNumber},</if>
<if test="privatePlacement != null">private_placement = #{privatePlacement},</if>
<if test="toPrivatePlacement != null">to_private_placement = #{toPrivatePlacement},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCoinConfigByIds" parameterType="String">
delete from coin_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>