<?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.ActSuppliesRoleDetailMapper"> <resultMap type="ActSuppliesRoleDetail" id="ActSuppliesRoleDetailResult"> <result property="id" column="id" /> <result property="roleId" column="role_id" /> <result property="detailName" column="detail_name" /> <result property="detailContent" column="detail_content" /> <result property="status" column="status" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectActSuppliesRoleDetailVo"> select id, role_id, detail_name, detail_content, status, create_by, create_time, update_by, update_time from act_supplies_role_detail </sql> <select id="selectActSuppliesRoleDetailList" parameterType="ActSuppliesRoleDetail" resultMap="ActSuppliesRoleDetailResult"> <include refid="selectActSuppliesRoleDetailVo"/> <where> <if test="roleId != null "> and role_id = #{roleId}</if> <if test="detailName != null and detailName != ''"> and detail_name like concat('%', #{detailName}, '%')</if> <if test="detailContent != null and detailContent != ''"> and detail_content = #{detailContent}</if> <if test="status != null "> and status = #{status}</if> </where> </select> <select id="selectActSuppliesRoleDetailById" parameterType="Integer" resultMap="ActSuppliesRoleDetailResult"> <include refid="selectActSuppliesRoleDetailVo"/> where id = #{id} </select> <insert id="insertActSuppliesRoleDetail" parameterType="ActSuppliesRoleDetail" useGeneratedKeys="true" keyProperty="id"> insert into act_supplies_role_detail <trim prefix="(" suffix=")" suffixOverrides=","> <if test="roleId != null">role_id,</if> <if test="detailName != null">detail_name,</if> <if test="detailContent != null">detail_content,</if> <if test="status != null">status,</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="roleId != null">#{roleId},</if> <if test="detailName != null">#{detailName},</if> <if test="detailContent != null">#{detailContent},</if> <if test="status != null">#{status},</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> </insert> <update id="updateActSuppliesRoleDetail" parameterType="ActSuppliesRoleDetail"> update act_supplies_role_detail <trim prefix="SET" suffixOverrides=","> <if test="roleId != null">role_id = #{roleId},</if> <if test="detailName != null">detail_name = #{detailName},</if> <if test="detailContent != null">detail_content = #{detailContent},</if> <if test="status != null">status = #{status},</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} </update> <delete id="deleteActSuppliesRoleDetailById" parameterType="Integer"> delete from act_supplies_role_detail where id = #{id} </delete> <delete id="deleteActSuppliesRoleDetailByIds" parameterType="String"> delete from act_supplies_role_detail where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>