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

99 lines
4.9 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.NodePriceConfigMapper">
<resultMap type="com.ruoyi.system.domain.NodePriceConfig" id="NodePriceConfigResult">
<result property="id" column="id" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="nodeSettingId" column="node_setting_id" />
<result property="startNum" column="start_num" />
<result property="endNum" column="end_num" />
<result property="price" column="price" />
</resultMap>
<sql id="selectNodePriceConfigVo">
select id, create_time, create_by, update_time, update_by, node_setting_id, start_num, end_num, price from node_price_config
</sql>
<select id="selectNodePriceConfigList" parameterType="com.ruoyi.system.domain.NodePriceConfig" resultMap="NodePriceConfigResult">
<include refid="selectNodePriceConfigVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="nodeSettingId != null "> and node_setting_id = #{nodeSettingId}</if>
<if test="startNum != null "> and start_num = #{startNum}</if>
<if test="endNum != null "> and end_num = #{endNum}</if>
<if test="price != null "> and price = #{price}</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="findNodePriceConfig" parameterType="com.ruoyi.system.domain.NodePriceConfig" resultMap="NodePriceConfigResult">
<include refid="selectNodePriceConfigVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="nodeSettingId != null "> and node_setting_id = #{nodeSettingId}</if>
<if test="startNum != null "> and start_num = #{startNum}</if>
<if test="endNum != null "> and end_num = #{endNum}</if>
<if test="price != null "> and price = #{price}</if>
</where>
limit 1
</select>
<select id="selectNodePriceConfigById" parameterType="Integer" resultMap="NodePriceConfigResult">
<include refid="selectNodePriceConfigVo"/>
where id = #{id}
</select>
<insert id="insertNodePriceConfig" parameterType="com.ruoyi.system.domain.NodePriceConfig" useGeneratedKeys="true" keyProperty="id">
insert into node_price_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="nodeSettingId != null">node_setting_id,</if>
<if test="startNum != null">start_num,</if>
<if test="endNum != null">end_num,</if>
<if test="price != null">price,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="nodeSettingId != null">#{nodeSettingId},</if>
<if test="startNum != null">#{startNum},</if>
<if test="endNum != null">#{endNum},</if>
<if test="price != null">#{price},</if>
</trim>
</insert>
<update id="updateNodePriceConfig" parameterType="com.ruoyi.system.domain.NodePriceConfig">
update node_price_config
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="nodeSettingId != null">node_setting_id = #{nodeSettingId},</if>
<if test="startNum != null">start_num = #{startNum},</if>
<if test="endNum != null">end_num = #{endNum},</if>
<if test="price != null">price = #{price},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNodePriceConfigByIds" parameterType="String">
delete from node_price_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>