tj
2025-03-20 5ac56c82c48200f5bfd82917d04279ff502a906f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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>