<?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.tofly.watermeter.mapper.QfkhjbxxYsxzMapper">

    <resultMap id="qfkhjbxxYsxzMap" type="com.tofly.watermeter.entity.QfkhjbxxYsxz">
        <id property="id" column="ID"/>
        <result property="yhbh" column="YHBH"/>
        <result property="ysxz" column="YSXZ"/>
        <result property="xzxf" column="XZXF"/>
        <result property="zyys" column="ZYYS"/>
    </resultMap>

    <insert id="saveBatchQfkhjbxxYsxz">
        insert into TF_YWPN_QFKHJBXX_YSXZ_W(ID , YHBH , YSXZ,XZXF,ZYYS)
        <foreach collection="list" item="l" separator="union all">
            select
            #{l.id} ,
            #{l.yhbh},
            #{l.ysxz},
            #{l.xzxf},
           <choose>
               <when test="l.zyys != null">#{l.zyys}</when>
               <otherwise>0</otherwise>
           </choose>
            from dual
        </foreach>
    </insert>


</mapper>
