Bonus-Cloud-Material/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmConfigMapper.xml

81 lines
3.7 KiB
XML
Raw Normal View History

2024-09-25 15:06:07 +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.bonus.material.basic.mapper.BmConfigMapper">
<resultMap type="com.bonus.material.basic.domain.BmConfig" id="BmConfigResult">
2024-09-26 16:15:51 +08:00
<result property="id" column="id" />
<result property="itemName" column="item_name" />
<result property="itemValue" column="item_value" />
<result property="createBy" column="create_by" />
2024-09-25 15:06:07 +08:00
<result property="createTime" column="create_time" />
2024-09-26 16:15:51 +08:00
<result property="updateBy" column="update_by" />
2024-09-25 15:06:07 +08:00
<result property="updateTime" column="update_time" />
</resultMap>
2024-09-26 16:15:51 +08:00
<sql id="selectBmConfigVo">
select id, item_name, item_value, create_by, create_time, update_by, update_time from bm_config
2024-09-25 15:06:07 +08:00
</sql>
2024-09-26 16:15:51 +08:00
<select id="selectBmConfigList" parameterType="com.bonus.material.basic.domain.BmConfig" resultMap="BmConfigResult">
<include refid="selectBmConfigVo"/>
<where>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="itemValue != null and itemValue != ''"> and item_value = #{itemValue}</if>
</where>
2024-09-25 15:06:07 +08:00
</select>
2024-09-26 16:15:51 +08:00
<select id="selectBmConfigById" parameterType="Long" resultMap="BmConfigResult">
<include refid="selectBmConfigVo"/>
where id = #{id}
2024-09-25 15:06:07 +08:00
</select>
2024-09-30 17:58:59 +08:00
<select id="selectBmConfigByItemName" parameterType="String" resultMap="BmConfigResult">
<include refid="selectBmConfigVo"/>
where itemName = #{itemName}
</select>
2024-09-26 16:15:51 +08:00
<insert id="insertBmConfig" parameterType="com.bonus.material.basic.domain.BmConfig" useGeneratedKeys="true" keyProperty="id">
insert into bm_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemName != null">item_name,</if>
<if test="itemValue != null">item_value,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemName != null">#{itemName},</if>
<if test="itemValue != null">#{itemValue},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
2024-09-25 15:06:07 +08:00
</insert>
2024-09-26 16:15:51 +08:00
<update id="updateBmConfig" parameterType="com.bonus.material.basic.domain.BmConfig">
update bm_config
<trim prefix="SET" suffixOverrides=",">
<if test="itemName != null">item_name = #{itemName},</if>
<if test="itemValue != null">item_value = #{itemValue},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
2024-09-25 15:06:07 +08:00
</update>
2024-09-26 16:15:51 +08:00
<delete id="deleteBmConfigById" parameterType="Long">
delete from bm_config where id = #{id}
2024-09-25 15:06:07 +08:00
</delete>
2024-09-26 16:15:51 +08:00
<delete id="deleteBmConfigByIds" parameterType="String">
delete from bm_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
2024-09-25 15:06:07 +08:00
</foreach>
</delete>
</mapper>