<?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="cn.timer.api.dao.kqmk.KqglAssoKqjMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoKqj" >
                <id column="id" property="id" />
                <result column="name" property="name" />
                <result column="code" property="code" />
                <result column="qyid" property="qyid" />
                <result column="lusj_time" property="lusjTime" />
                <result column="luryid" property="luryid" />
                <result column="type" property="type" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                name,
                code,
                qyid,
                lusj_time,
                luryid,
                type
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id KqglAssoKqj_id,
                name KqglAssoKqj_name,
                code KqglAssoKqj_code,
                qyid KqglAssoKqj_qyid,
                lusj_time KqglAssoKqj_lusj_time,
                luryid KqglAssoKqj_luryid,
                type KqglAssoKqj_type
    </sql>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoKqj">
        INSERT INTO kqgl_asso_kqj
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != code'>
                        code,
                        </if>
                        <if test ='null != qyid'>
                        qyid,
                        </if>
                        <if test ='null != lusjTime'>
                        lusj_time,
                        </if>
                        <if test ='null != luryid'>
                        luryid,
                        </if>
                        <if test ='null != type'>
                        type
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != code'>
                        #{code},
                        </if>
                        <if test ='null != qyid'>
                        #{qyid},
                        </if>
                        <if test ='null != lusjTime'>
                        #{lusjTime},
                        </if>
                        <if test ='null != luryid'>
                        #{luryid},
                        </if>
                        <if test ='null != type'>
                        #{type}
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM kqgl_asso_kqj
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoKqj">
        UPDATE kqgl_asso_kqj
        <set>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != code'>code = #{code},</if>
                    <if test ='null != qyid'>qyid = #{qyid},</if>
                    <if test ='null != lusjTime'>lusj_time = #{lusjTime},</if>
                    <if test ='null != luryid'>luryid = #{luryid},</if>
                    <if test ='null != type'>type = #{type}</if>
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_asso_kqj
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM kqgl_asso_kqj
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM kqgl_asso_kqj
    </select>

	 -->

</mapper>