You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.7 KiB
66 lines
2.7 KiB
|
3 months ago
|
<?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.PlatformLibMapper">
|
||
|
|
|
||
|
|
<resultMap type="PlatformLib" id="PlatformLibResult">
|
||
|
|
<result property="id" column="id" />
|
||
|
|
<result property="name" column="name" />
|
||
|
|
<result property="type" column="type" />
|
||
|
|
<result property="specsJson" column="specs_json" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectPlatformLibVo">
|
||
|
|
select id, name, type, specs_json from platform_lib
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPlatformLibList" parameterType="PlatformLib" resultMap="PlatformLibResult">
|
||
|
|
<include refid="selectPlatformLibVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||
|
|
<if test="specsJson != null and specsJson != ''"> and specs_json = #{specsJson}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPlatformLibById" parameterType="Long" resultMap="PlatformLibResult">
|
||
|
|
<include refid="selectPlatformLibVo"/>
|
||
|
|
where id = #{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertPlatformLib" parameterType="PlatformLib" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into platform_lib
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="name != null and name != ''">name,</if>
|
||
|
|
<if test="type != null and type != ''">type,</if>
|
||
|
|
<if test="specsJson != null and specsJson != ''">specs_json,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="name != null and name != ''">#{name},</if>
|
||
|
|
<if test="type != null and type != ''">#{type},</if>
|
||
|
|
<if test="specsJson != null and specsJson != ''">#{specsJson},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updatePlatformLib" parameterType="PlatformLib">
|
||
|
|
update platform_lib
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
||
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
||
|
|
<if test="specsJson != null and specsJson != ''">specs_json = #{specsJson},</if>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deletePlatformLibById" parameterType="Long">
|
||
|
|
delete from platform_lib where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deletePlatformLibByIds" parameterType="String">
|
||
|
|
delete from platform_lib where id in
|
||
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|