TEnterpriseSystemMapper.xml 7.43 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
3 4
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
耿迪迪's avatar
耿迪迪 committed
5
<mapper namespace="com.zehong.system.mapper.TEnterpriseSystemMapper">
6

耿迪迪's avatar
耿迪迪 committed
7 8 9 10
    <resultMap type="TEnterpriseSystem" id="TEnterpriseSystemResult">
        <result property="systemId"    column="system_id"    />
        <result property="systemTitle"    column="system_title"    />
        <result property="systemType"    column="system_type"    />
11 12 13 14
        <result property="hierarchy"    column="hierarchy"    />
        <result property="referenceNum"    column="reference_num"    />
        <result property="issueDept"    column="issue_dept"    />
        <result property="availability"    column="availability"    />
耿迪迪's avatar
耿迪迪 committed
15 16 17 18 19 20 21 22 23
        <result property="contentType"    column="content_type"    />
        <result property="content"    column="content"    />
        <result property="fileName"    column="file_name"    />
        <result property="fileUrl"    column="file_url"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="status"    column="status"    />
24
        <result property="isDel"    column="is_del"    />
耿迪迪's avatar
耿迪迪 committed
25 26 27 28
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectTEnterpriseSystemVo">
29
        select system_id, system_title, system_type, hierarchy, reference_num, issue_dept, availability, content_type, content, file_name, file_url, create_by, create_time, update_by, update_time, status, is_del, remark from t_enterprise_system
耿迪迪's avatar
耿迪迪 committed
30 31 32 33
    </sql>

    <select id="selectTEnterpriseSystemList" parameterType="TEnterpriseSystem" resultMap="TEnterpriseSystemResult">
        <include refid="selectTEnterpriseSystemVo"/>
34 35
        <where>
            <if test="systemTitle != null  and systemTitle != ''"> and system_title = #{systemTitle}</if>
耿迪迪's avatar
耿迪迪 committed
36
            <if test="systemType != null  and systemType != ''"> and system_type = #{systemType}</if>
37 38 39 40
            <if test="hierarchy != null  and hierarchy != ''"> and hierarchy = #{hierarchy}</if>
            <if test="referenceNum != null  and referenceNum != ''"> and reference_num = #{referenceNum}</if>
            <if test="issueDept != null  and issueDept != ''"> and issue_dept = #{issueDept}</if>
            <if test="availability != null  and availability != ''"> and availability = #{availability}</if>
耿迪迪's avatar
耿迪迪 committed
41 42 43 44 45
            <if test="contentType != null  and contentType != ''"> and content_type = #{contentType}</if>
            <if test="content != null  and content != ''"> and content = #{content}</if>
            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
46
            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
耿迪迪's avatar
耿迪迪 committed
47 48
        </where>
    </select>
49

耿迪迪's avatar
耿迪迪 committed
50 51 52 53
    <select id="selectTEnterpriseSystemById" parameterType="Long" resultMap="TEnterpriseSystemResult">
        <include refid="selectTEnterpriseSystemVo"/>
        where system_id = #{systemId}
    </select>
54

耿迪迪's avatar
耿迪迪 committed
55 56 57 58 59
    <insert id="insertTEnterpriseSystem" parameterType="TEnterpriseSystem" useGeneratedKeys="true" keyProperty="systemId">
        insert into t_enterprise_system
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="systemTitle != null">system_title,</if>
            <if test="systemType != null">system_type,</if>
60 61 62 63
            <if test="hierarchy != null">hierarchy,</if>
            <if test="referenceNum != null">reference_num,</if>
            <if test="issueDept != null">issue_dept,</if>
            <if test="availability != null">availability,</if>
耿迪迪's avatar
耿迪迪 committed
64 65 66 67 68 69 70 71 72
            <if test="contentType != null">content_type,</if>
            <if test="content != null">content,</if>
            <if test="fileName != null">file_name,</if>
            <if test="fileUrl != null">file_url,</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>
            <if test="status != null">status,</if>
73
            <if test="isDel != null">is_del,</if>
耿迪迪's avatar
耿迪迪 committed
74
            <if test="remark != null">remark,</if>
75
        </trim>
耿迪迪's avatar
耿迪迪 committed
76 77 78
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemTitle != null">#{systemTitle},</if>
            <if test="systemType != null">#{systemType},</if>
79 80 81 82
            <if test="hierarchy != null">#{hierarchy},</if>
            <if test="referenceNum != null">#{referenceNum},</if>
            <if test="issueDept != null">#{issueDept},</if>
            <if test="availability != null">#{availability},</if>
耿迪迪's avatar
耿迪迪 committed
83 84 85 86 87 88 89 90 91
            <if test="contentType != null">#{contentType},</if>
            <if test="content != null">#{content},</if>
            <if test="fileName != null">#{fileName},</if>
            <if test="fileUrl != null">#{fileUrl},</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>
            <if test="status != null">#{status},</if>
92
            <if test="isDel != null">#{isDel},</if>
耿迪迪's avatar
耿迪迪 committed
93
            <if test="remark != null">#{remark},</if>
94
        </trim>
耿迪迪's avatar
耿迪迪 committed
95 96 97 98 99 100 101
    </insert>

    <update id="updateTEnterpriseSystem" parameterType="TEnterpriseSystem">
        update t_enterprise_system
        <trim prefix="SET" suffixOverrides=",">
            <if test="systemTitle != null">system_title = #{systemTitle},</if>
            <if test="systemType != null">system_type = #{systemType},</if>
102 103 104 105
            <if test="hierarchy != null">hierarchy = #{hierarchy},</if>
            <if test="referenceNum != null">reference_num = #{referenceNum},</if>
            <if test="issueDept != null">issue_dept = #{issueDept},</if>
            <if test="availability != null">availability = #{availability},</if>
耿迪迪's avatar
耿迪迪 committed
106 107 108 109 110 111 112 113 114
            <if test="contentType != null">content_type = #{contentType},</if>
            <if test="content != null">content = #{content},</if>
            <if test="fileName != null">file_name = #{fileName},</if>
            <if test="fileUrl != null">file_url = #{fileUrl},</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>
            <if test="status != null">status = #{status},</if>
115
            <if test="isDel != null">is_del = #{isDel},</if>
耿迪迪's avatar
耿迪迪 committed
116 117 118 119 120 121 122 123 124 125
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where system_id = #{systemId}
    </update>

    <delete id="deleteTEnterpriseSystemById" parameterType="Long">
        delete from t_enterprise_system where system_id = #{systemId}
    </delete>

    <delete id="deleteTEnterpriseSystemByIds" parameterType="String">
126
        delete from t_enterprise_system where system_id in
耿迪迪's avatar
耿迪迪 committed
127 128 129 130 131
        <foreach item="systemId" collection="array" open="(" separator="," close=")">
            #{systemId}
        </foreach>
    </delete>
</mapper>