93 lines
3.8 KiB
XML
93 lines
3.8 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.ServiceCateMapper">
|
|
|
|
<resultMap type="ServiceCate" id="ServiceCateResult">
|
|
<result property="id" column="id" />
|
|
<result property="title" column="title" />
|
|
<result property="icon" column="icon" />
|
|
<result property="sort" column="sort" />
|
|
<result property="status" column="status" />
|
|
<result property="browse" column="browse" />
|
|
<result property="type" column="type" />
|
|
<result property="createdAt" column="created_at" />
|
|
<result property="updatedAt" column="updated_at" />
|
|
<result property="deletedAt" column="deleted_at" />
|
|
</resultMap>
|
|
|
|
<sql id="selectServiceCateVo">
|
|
select id, title, icon, sort, status, browse, type, created_at, updated_at, deleted_at from service_cate
|
|
</sql>
|
|
|
|
<select id="selectServiceCateList" parameterType="ServiceCate" resultMap="ServiceCateResult">
|
|
<include refid="selectServiceCateVo"/>
|
|
<where>
|
|
<if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
|
|
<if test="status != null and status != ''"> and status=#{status}</if>
|
|
<if test="type != null and type != ''"> and type=#{type}</if>
|
|
|
|
</where>
|
|
order by sort ASC
|
|
</select>
|
|
<select id="selectServiceCateById" parameterType="Long" resultMap="ServiceCateResult">
|
|
<include refid="selectServiceCateVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertServiceCate" parameterType="ServiceCate" useGeneratedKeys="true" keyProperty="id">
|
|
insert into service_cate
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="title != null and title != ''">title,</if>
|
|
<if test="icon != null">icon,</if>
|
|
<if test="sort != null">sort,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="browse != null">browse,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="deletedAt != null">deleted_at,</if>
|
|
created_at,
|
|
updated_at
|
|
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="title != null and title != ''">#{title},</if>
|
|
<if test="icon != null">#{icon},</if>
|
|
<if test="sort != null">#{sort},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="browse != null">#{browse},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="deletedAt != null">#{deletedAt},</if>
|
|
NOW(),
|
|
NOW()
|
|
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateServiceCate" parameterType="ServiceCate">
|
|
update service_cate
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="title != null and title != ''">title = #{title},</if>
|
|
<if test="icon != null">icon = #{icon},</if>
|
|
<if test="sort != null">sort = #{sort},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="browse != null">browse = #{browse},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
|
|
updated_at = NOW()
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteServiceCateById" parameterType="Long">
|
|
delete from service_cate where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteServiceCateByIds" parameterType="String">
|
|
delete from service_cate where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |