TEventInfoMapper.xml 7.05 KB
Newer Older
zhangjianqian's avatar
zhangjianqian committed
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
<?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.zehong.system.mapper.TEventInfoMapper">
    
    <resultMap type="TEventInfo" id="TEventInfoResult">
        <result property="eventId"    column="event_id"    />
        <result property="eventTitle"    column="event_title"    />
        <result property="eventType"    column="event_type"    />
        <result property="eventLevel"    column="event_level"    />
        <result property="eventLocation"    column="event_location"    />
        <result property="reportTime"    column="report_time"    />
        <result property="reportPerson"    column="report_person"    />
        <result property="eventDeal"    column="event_deal"    />
        <result property="eventAssessment"    column="event_assessment"    />
        <result property="beyondEnterpriseId"    column="beyond_enterprise_id"    />
        <result property="beyondEnterpriseName"    column="beyond_enterprise_name"    />
        <result property="iconUrl"    column="icon_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="isDel"    column="is_del"    />
        <result property="remarks"    column="remarks"    />
    </resultMap>

    <sql id="selectTEventInfoVo">
        select event_id, event_title, event_type, event_level, event_location, report_time, report_person, event_deal, event_assessment, beyond_enterprise_id, beyond_enterprise_name, icon_url, create_by, create_time, update_by, update_time, is_del, remarks from t_event_info
    </sql>

    <select id="selectTEventInfoList" parameterType="TEventInfo" resultMap="TEventInfoResult">
        <include refid="selectTEventInfoVo"/>
        <where>  
            <if test="eventTitle != null  and eventTitle != ''"> and event_title like concat('%', #{eventTitle}, '%')</if>
            <if test="eventType != null  and eventType != ''"> and event_type = #{eventType}</if>
            <if test="eventLevel != null  and eventLevel != ''"> and event_level = #{eventLevel}</if>
            <if test="reportPerson != null  and reportPerson != ''"> and report_person like concat('%', #{reportPerson}, '%')</if>
            <if test="beyondEnterpriseId != null  and beyondEnterpriseId != ''"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
        </where>
zhangjianqian's avatar
zhangjianqian committed
41
        order by report_time
zhangjianqian's avatar
zhangjianqian committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    </select>
    
    <select id="selectTEventInfoById" parameterType="Long" resultMap="TEventInfoResult">
        <include refid="selectTEventInfoVo"/>
        where event_id = #{eventId}
    </select>
        
    <insert id="insertTEventInfo" parameterType="TEventInfo" useGeneratedKeys="true" keyProperty="eventId">
        insert into t_event_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="eventTitle != null">event_title,</if>
            <if test="eventType != null">event_type,</if>
            <if test="eventLevel != null">event_level,</if>
            <if test="eventLocation != null">event_location,</if>
            <if test="reportTime != null">report_time,</if>
            <if test="reportPerson != null">report_person,</if>
            <if test="eventDeal != null">event_deal,</if>
            <if test="eventAssessment != null">event_assessment,</if>
            <if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
            <if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
            <if test="iconUrl != null">icon_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="isDel != null">is_del,</if>
            <if test="remarks != null">remarks,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="eventTitle != null">#{eventTitle},</if>
            <if test="eventType != null">#{eventType},</if>
            <if test="eventLevel != null">#{eventLevel},</if>
            <if test="eventLocation != null">#{eventLocation},</if>
            <if test="reportTime != null">#{reportTime},</if>
            <if test="reportPerson != null">#{reportPerson},</if>
            <if test="eventDeal != null">#{eventDeal},</if>
            <if test="eventAssessment != null">#{eventAssessment},</if>
            <if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
            <if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
            <if test="iconUrl != null">#{iconUrl},</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="isDel != null">#{isDel},</if>
            <if test="remarks != null">#{remarks},</if>
         </trim>
    </insert>

    <update id="updateTEventInfo" parameterType="TEventInfo">
        update t_event_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="eventTitle != null">event_title = #{eventTitle},</if>
            <if test="eventType != null">event_type = #{eventType},</if>
            <if test="eventLevel != null">event_level = #{eventLevel},</if>
            <if test="eventLocation != null">event_location = #{eventLocation},</if>
            <if test="reportTime != null">report_time = #{reportTime},</if>
            <if test="reportPerson != null">report_person = #{reportPerson},</if>
            <if test="eventDeal != null">event_deal = #{eventDeal},</if>
            <if test="eventAssessment != null">event_assessment = #{eventAssessment},</if>
            <if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
            <if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
            <if test="iconUrl != null">icon_url = #{iconUrl},</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="isDel != null">is_del = #{isDel},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
        </trim>
        where event_id = #{eventId}
    </update>

    <delete id="deleteTEventInfoById" parameterType="Long">
        delete from t_event_info where event_id = #{eventId}
    </delete>

    <delete id="deleteTEventInfoByIds" parameterType="String">
        delete from t_event_info where event_id in 
        <foreach item="eventId" collection="array" open="(" separator="," close=")">
            #{eventId}
        </foreach>
    </delete>
</mapper>