<?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.yinet.system.mapper.TouchScreenHelpInfoMapper">
    <resultMap type="TouchScreenHelpInfo" id="TouchScreenHelpInfoResult">
        <id property="tsHelpinfoId" column="ts_helpinfo_id"/>
        <result property="title" column="title"/>
        <result property="content" column="content"/>
        <result property="submitTime" column="submit_time"/>
    </resultMap>
    <select id="selectHelpInfoList" resultMap="TouchScreenHelpInfoResult">
        SELECT * from touch_screen_help_info
    </select>
    <insert id="insertHelpInfo" parameterType="com.yinet.system.domain.TouchScreenHelpInfo">
        INSERT INTO touch_screen_help_info ( ts_helpinfo_id,title,content,submit_time )
        VALUES
        (
        #{touchScreenHelpInfo.tsHelpinfoId},
        #{touchScreenHelpInfo.title},
        #{touchScreenHelpInfo.content},
        #{touchScreenHelpInfo.submitTime}
        )
    </insert>

    <select id="selectHelpInfoById" resultMap="TouchScreenHelpInfoResult">
        SELECT * from touch_screen_help_info where ts_helpinfo_id= #{id}
    </select>

    <update id="updateHelpInfo" parameterType="com.yinet.system.domain.TouchScreenHelpInfo">
        UPDATE touch_screen_help_info
        SET title = #{touchScreenHelpInfo.title}
        ,content=#{touchScreenHelpInfo.content},submit_time=#{touchScreenHelpInfo.submitTime}
        WHERE
        ts_helpinfo_id = #{touchScreenHelpInfo.tsHelpinfoId};
    </update>
    <delete id="deletHelpInfo" parameterType="String">
        DELETE FROM touch_screen_help_info where ts_helpinfo_id in
        <foreach collection="array" item="ids" open="(" separator="," close=")">
            #{ids}
        </foreach>
    </delete>
    <select id="selectHelpInfoLimit" resultMap="TouchScreenHelpInfoResult">
        select * from touch_screen_help_info ORDER BY submit_time desc limit #{count}
    </select>
</mapper> 