<?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.jianshui.system.mapper.InvoiceAllLoginResultMapper">
    
    <resultMap type="InvoiceAllLoginResult" id="InvoiceAllLoginResultResult">
        <result property="id"    column="id"    />
        <result property="code"    column="code"    />
        <result property="data"    column="data"    />
        <result property="msg"    column="msg"    />
        <result property="success"    column="success"    />
        <result property="trace"    column="trace"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectInvoiceAllLoginResultVo">
        select id, code, data, msg, success, trace, create_time, update_time from invoice_all_login_result
    </sql>

    <select id="selectInvoiceAllLoginResultList" parameterType="InvoiceAllLoginResult" resultMap="InvoiceAllLoginResultResult">
        <include refid="selectInvoiceAllLoginResultVo"/>
        <where>  
            <if test="code != null  and code != ''"> and code = #{code}</if>
            <if test="data != null  and data != ''"> and data = #{data}</if>
            <if test="msg != null  and msg != ''"> and msg = #{msg}</if>
            <if test="success != null "> and success = #{success}</if>
            <if test="trace != null  and trace != ''"> and trace = #{trace}</if>
        </where>
    </select>
    
    <select id="selectInvoiceAllLoginResultById" parameterType="Long" resultMap="InvoiceAllLoginResultResult">
        <include refid="selectInvoiceAllLoginResultVo"/>
        where id = #{id}
    </select>
    <select id="findByQqlsh" resultMap="InvoiceAllLoginResultResult">
        select * from invoice_all_login_result where trace = #{qqlsh}
    </select>

    <insert id="insertInvoiceAllLoginResult" parameterType="InvoiceAllLoginResult" useGeneratedKeys="true" keyProperty="id">
        insert into invoice_all_login_result
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="code != null">code,</if>
            <if test="data != null">data,</if>
            <if test="msg != null">msg,</if>
            <if test="success != null">success,</if>
            <if test="trace != null">trace,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="code != null">#{code},</if>
            <if test="data != null">#{data},</if>
            <if test="msg != null">#{msg},</if>
            <if test="success != null">#{success},</if>
            <if test="trace != null">#{trace},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateInvoiceAllLoginResult" parameterType="InvoiceAllLoginResult">
        update invoice_all_login_result
        <trim prefix="SET" suffixOverrides=",">
            <if test="code != null">code = #{code},</if>
            <if test="data != null">data = #{data},</if>
            <if test="msg != null">msg = #{msg},</if>
            <if test="success != null">success = #{success},</if>
            <if test="trace != null">trace = #{trace},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <update id="updateInvoiceResult">
        update invoice_all_login_result
        <trim prefix="SET" suffixOverrides=",">
            <if test="code != null">code = #{code},</if>
            <if test="data != null">data = #{data},</if>
            <if test="msg != null">msg = #{msg},</if>
            <if test="success != null">success = #{success},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where trace = #{trace}
    </update>

    <delete id="deleteInvoiceAllLoginResultById" parameterType="Long">
        delete from invoice_all_login_result where id = #{id}
    </delete>

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