huaguoshan-admin/ruoyi-system/target/classes/mapper/system/CmsMaterialUseMapper.xml

84 lines
3.9 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.CmsMaterialUseMapper">
<resultMap type="CmsMaterialUse" id="CmsMaterialUseResult">
<result property="id" column="id" />
<result property="materialId" column="material_id" />
<result property="useTable" column="use_table" />
<result property="useId" column="use_id" />
<result property="useColumn" column="use_column" />
<result property="userId" column="user_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectCmsMaterialUseVo">
select id, material_id, use_table, use_id, use_column, user_id, create_by, create_time from cms_material_use
</sql>
<select id="selectCmsMaterialUseList" parameterType="CmsMaterialUse" resultMap="CmsMaterialUseResult">
<include refid="selectCmsMaterialUseVo"/>
<where>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
<if test="useTable != null and useTable != ''"> and use_table = #{useTable}</if>
<if test="useId != null and useId != ''"> and use_id = #{useId}</if>
<if test="useColumn != null and useColumn != ''"> and use_column = #{useColumn}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
</where>
</select>
<select id="selectCmsMaterialUseById" parameterType="Long" resultMap="CmsMaterialUseResult">
<include refid="selectCmsMaterialUseVo"/>
where id = #{id}
</select>
<insert id="insertCmsMaterialUse" parameterType="CmsMaterialUse" useGeneratedKeys="true" keyProperty="id">
insert into cms_material_use
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialId != null">material_id,</if>
<if test="useTable != null">use_table,</if>
<if test="useId != null">use_id,</if>
<if test="useColumn != null">use_column,</if>
<if test="userId != null">user_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialId != null">#{materialId},</if>
<if test="useTable != null">#{useTable},</if>
<if test="useId != null">#{useId},</if>
<if test="useColumn != null">#{useColumn},</if>
<if test="userId != null">#{userId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateCmsMaterialUse" parameterType="CmsMaterialUse">
update cms_material_use
<trim prefix="SET" suffixOverrides=",">
<if test="materialId != null">material_id = #{materialId},</if>
<if test="useTable != null">use_table = #{useTable},</if>
<if test="useId != null">use_id = #{useId},</if>
<if test="useColumn != null">use_column = #{useColumn},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCmsMaterialUseById" parameterType="Long">
delete from cms_material_use where id = #{id}
</delete>
<delete id="deleteCmsMaterialUseByIds" parameterType="String">
delete from cms_material_use where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>