<?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.jsh.erp.datasource.mappers.CloudContentMapper"> 
 | 
    <select id="selectList" resultType="com.jsh.erp.datasource.entities.CloudContent"> 
 | 
        select * from cloud_content 
 | 
        <where> 
 | 
            <if test="type != null and type != ''"> 
 | 
                and type = #{type} 
 | 
            </if> 
 | 
            <if test="title != null and title != ''"> 
 | 
                and title like concat('%', #{title}, '%') 
 | 
            </if> 
 | 
            <if test="status != null"> 
 | 
                and status = #{status} 
 | 
            </if> 
 | 
        </where> 
 | 
        order by create_time desc 
 | 
    </select> 
 | 
  
 | 
    <select id="selectById" resultType="com.jsh.erp.datasource.entities.CloudContent"> 
 | 
        select * from cloud_content where id = #{id} 
 | 
    </select> 
 | 
  
 | 
    <insert id="insert" parameterType="com.jsh.erp.datasource.entities.CloudContent"> 
 | 
        insert into cloud_content 
 | 
        (type, title, content, version, status, create_time, creator, update_time, updater) 
 | 
        values 
 | 
        (#{type}, #{title}, #{content}, #{version}, #{status}, now(), #{creator}, now(), #{updater}) 
 | 
    </insert> 
 | 
  
 | 
    <update id="update" parameterType="com.jsh.erp.datasource.entities.CloudContent"> 
 | 
        update cloud_content 
 | 
        <set> 
 | 
            <if test="type != null">type = #{type},</if> 
 | 
            <if test="title != null">title = #{title},</if> 
 | 
            <if test="content != null">content = #{content},</if> 
 | 
            <if test="version != null">version = #{version},</if> 
 | 
            <if test="status != null">status = #{status},</if> 
 | 
            update_time = now(), 
 | 
            <if test="updater != null">updater = #{updater},</if> 
 | 
        </set> 
 | 
        where id = #{id} 
 | 
    </update> 
 | 
  
 | 
    <delete id="deleteById"> 
 | 
        delete from cloud_content where id = #{id} 
 | 
    </delete> 
 | 
</mapper>  
 |