<?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.qianhe.zqbf.mapper.ZqczXmzBffkMapper">
    <!--  返回实体  -->
    <resultMap id="ZqczXmzBffkResult" type="ZqczXmzBffk">
        <result property="fkid" column="fkid"/>
        <result property="xqid" column="xqid"/>
        <result property="gw" column="gw"/>
        <result property="myd" column="myd"/>
        <result property="bzcd" column="bzcd"/>
        <result property="zdfs" column="zdfs"/>
        <result property="bfts" column="bfts"/>
        <result property="zdsc" column="zdsc"/>
        <result property="jtjy" column="jtjy"/>
        <result property="gxr" column="gxr"/>
        <result property="gxsj" column="gxsj"/>
        <result property="bz" column="bz"/>
    </resultMap>
    <!--  通用查询  -->
    <sql id="selectCommon">
        SELECT fkid, xqid, gw, myd, bzcd, zdfs, bfts, zdsc, jtjy, gxr, gxsj, bz from zqcz_xmz_bffk
    </sql>
    <!--  查询详情  -->
    <select id="info" parameterType="long" resultMap="ZqczXmzBffkResult">
        <include refid="selectCommon"></include> WHERE xqid = #{id}
    </select>
    <!--  新增  -->
    <insert id="add" parameterType="ZqczXmzBffk">
        INSERT INTO zqcz_xmz_bffk
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="xqid != null ">xqid,</if>
            <if test="gw != null  and gw != ''">gw,</if>
            <if test="myd != null  and myd != ''">myd,</if>
            <if test="bzcd != null  and bzcd != ''">bzcd,</if>
            <if test="zdfs != null  and zdfs != ''">zdfs,</if>
            <if test="bfts != null  and bfts != ''">bfts,</if>
            <if test="zdsc != null  and zdsc != ''">zdsc,</if>
            <if test="jtjy != null  and jtjy != ''">jtjy,</if>
            <if test="gxr != null  and gxr != ''">gxr,</if>
            <if test="bz != null  and bz != ''">bz,</if>
            gxsj
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="xqid != null ">#{xqid},</if>
            <if test="gw != null  and gw != ''">#{gw},</if>
            <if test="myd != null  and myd != ''">#{myd},</if>
            <if test="bzcd != null  and bzcd != ''">#{bzcd},</if>
            <if test="zdfs != null  and zdfs != ''">#{zdfs},</if>
            <if test="bfts != null  and bfts != ''">#{bfts},</if>
            <if test="zdsc != null  and zdsc != ''">#{zdsc},</if>
            <if test="jtjy != null  and jtjy != ''">#{jtjy},</if>
            <if test="gxr != null  and gxr != ''">#{gxr},</if>
            <if test="bz != null  and bz != ''">#{bz},</if>
            now()
        </trim>
    </insert>
</mapper>