<?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.djhk.uav.policeInfo.mapper.PoliceInfoMapper">
    
    <resultMap type="com.djhk.common.api.domain.PoliceInfo" id="PoliceInfoResult">
        <result property="BGDH"    column="BGDH"    />
        <result property="bumJzoMc"    column="BUM_JZO_MC"    />
        <result property="bumJzoXxdm02"    column="BUM_JZO_XXDM02"    />
        <result property="cjgagzRq"    column="CJGAGZ_RQ"    />
        <result property="CJSJ"    column="CJSJ"    />
        <result property="CSRQ"    column="CSRQ"    />
        <result property="CYZJDM"    column="CYZJDM"    />
        <result property="cyzjMc"    column="CYZJ_MC"    />
        <result property="DWMC"    column="DWMC"    />
        <result property="FHXTSJWYBSID"    column="FHXTSJWYBSID"    />
        <result property="GMSFHM"    column="GMSFHM"    />
        <result property="GXSJ"    column="GXSJ"    />
        <result property="JH"    column="JH"    />
        <result property="jxiaDm"    column="JXIA_DM"    />
        <result property="jxiaMc"    column="JXIA_MC"    />
        <result property="kexXxdm02"    column="KEX_XXDM02"    />
        <result property="MZDM"    column="MZDM"    />
        <result property="MZMZWZ"    column="MZMZWZ"    />
        <result property="nbBh"    column="NB_BH"    />
        <result property="RYZTDM"    column="RYZTDM"    />
        <result property="RYZTMS"    column="RYZTMS"    />
        <result property="SJCJLYBM"    column="SJCJLYBM"    />
        <result property="SJCJLYBM1"    column="SJCJLYBM1"    />
        <result property="SJCJLYD"    column="SJCJLYD"    />
        <result property="SJCJLYXT"    column="SJCJLYXT"    />
        <result property="SJCJLYXTBZ"    column="SJCJLYXTBZ"    />
        <result property="SJKHSBSF"    column="SJKHSBSF"    />
        <result property="SJMGJBBM"    column="SJMGJBBM"    />
        <result property="XBDM"    column="XBDM"    />
        <result property="XBMZWZ"    column="XBMZWZ"    />
        <result property="xhHm"    column="XH_HM"    />
        <result property="XM"    column="XM"    />
        <result property="XWBQBS"    column="XWBQBS"    />
        <result property="xxscPdbz"    column="XXSC_PDBZ"    />
        <result property="YDDH"    column="YDDH"    />
        <result property="yiZw"    column="YI_ZW"    />
        <result property="YSXTJRZJ"    column="YSXTJRZJ"    />
        <result property="YWBQBS"    column="YWBQBS"    />
        <result property="zhijBh"    column="ZHIJ_BH"    />
        <result property="zhijMc"    column="ZHIJ_MC"    />
        <result property="ZJHM"    column="ZJHM"    />
        <result property="ZW"    column="ZW"    />
        <result property="zzjgDm"    column="ZZJG_DM"    />
    </resultMap>

    <sql id="selectPoliceInfoVo">
        select BGDH, BUM_JZO_MC, BUM_JZO_XXDM02, CJGAGZ_RQ, CJSJ, CSRQ, CYZJDM, CYZJ_MC, DWMC, FHXTSJWYBSID, GMSFHM, GXSJ, JH, JXIA_DM, JXIA_MC, KEX_XXDM02, MZDM, MZMZWZ, NB_BH, RYZTDM, RYZTMS, SJCJLYBM, SJCJLYBM1, SJCJLYD, SJCJLYXT, SJCJLYXTBZ, SJKHSBSF, SJMGJBBM, XBDM, XBMZWZ, XH_HM, XM, XWBQBS, XXSC_PDBZ, YDDH, YI_ZW, YSXTJRZJ, YWBQBS, ZHIJ_BH, ZHIJ_MC, ZJHM, ZW, ZZJG_DM from police_info
    </sql>

    <select id="selectPoliceInfoList" parameterType="com.djhk.common.api.domain.PoliceInfo" resultMap="PoliceInfoResult">
        <include refid="selectPoliceInfoVo"/>
        <where>  
            <if test="BGDH != null  and BGDH != ''"> and BGDH = #{BGDH}</if>
            <if test="bumJzoMc != null  and bumJzoMc != ''"> and BUM_JZO_MC = #{bumJzoMc}</if>
            <if test="bumJzoXxdm02 != null  and bumJzoXxdm02 != ''"> and BUM_JZO_XXDM02 = #{bumJzoXxdm02}</if>
            <if test="cjgagzRq != null  and cjgagzRq != ''"> and CJGAGZ_RQ = #{cjgagzRq}</if>
            <if test="CJSJ != null  and CJSJ != ''"> and CJSJ = #{CJSJ}</if>
            <if test="CSRQ != null  and CSRQ != ''"> and CSRQ = #{CSRQ}</if>
            <if test="CYZJDM != null  and CYZJDM != ''"> and CYZJDM = #{CYZJDM}</if>
            <if test="cyzjMc != null  and cyzjMc != ''"> and CYZJ_MC = #{cyzjMc}</if>
            <if test="DWMC != null  and DWMC != ''"> and DWMC = #{DWMC}</if>
            <if test="FHXTSJWYBSID != null  and FHXTSJWYBSID != ''"> and FHXTSJWYBSID = #{FHXTSJWYBSID}</if>
            <if test="GMSFHM != null  and GMSFHM != ''"> and GMSFHM = #{GMSFHM}</if>
            <if test="GXSJ != null  and GXSJ != ''"> and GXSJ = #{GXSJ}</if>
            <if test="JH != null  and JH != ''"> and JH like concat('%', #{JH}, '%')</if>
            <if test="jxiaDm != null  and jxiaDm != ''"> and JXIA_DM = #{jxiaDm}</if>
            <if test="jxiaMc != null  and jxiaMc != ''"> and JXIA_MC = #{jxiaMc}</if>
            <if test="kexXxdm02 != null  and kexXxdm02 != ''"> and KEX_XXDM02 = #{kexXxdm02}</if>
            <if test="MZDM != null  and MZDM != ''"> and MZDM = #{MZDM}</if>
            <if test="MZMZWZ != null  and MZMZWZ != ''"> and MZMZWZ = #{MZMZWZ}</if>
            <if test="nbBh != null  and nbBh != ''"> and NB_BH like concat('', #{nbBh}, '%')</if>
            <if test="RYZTDM != null  and RYZTDM != ''"> and RYZTDM = #{RYZTDM}</if>
            <if test="RYZTMS != null  and RYZTMS != ''"> and RYZTMS = #{RYZTMS}</if>
            <if test="SJCJLYBM != null  and SJCJLYBM != ''"> and SJCJLYBM = #{SJCJLYBM}</if>
            <if test="SJCJLYBM1 != null  and SJCJLYBM1 != ''"> and SJCJLYBM1 = #{SJCJLYBM1}</if>
            <if test="SJCJLYD != null  and SJCJLYD != ''"> and SJCJLYD = #{SJCJLYD}</if>
            <if test="SJCJLYXT != null  and SJCJLYXT != ''"> and SJCJLYXT = #{SJCJLYXT}</if>
            <if test="SJCJLYXTBZ != null  and SJCJLYXTBZ != ''"> and SJCJLYXTBZ = #{SJCJLYXTBZ}</if>
            <if test="SJKHSBSF != null  and SJKHSBSF != ''"> and SJKHSBSF = #{SJKHSBSF}</if>
            <if test="SJMGJBBM != null  and SJMGJBBM != ''"> and SJMGJBBM = #{SJMGJBBM}</if>
            <if test="XBDM != null  and XBDM != ''"> and XBDM = #{XBDM}</if>
            <if test="XBMZWZ != null  and XBMZWZ != ''"> and XBMZWZ = #{XBMZWZ}</if>
            <if test="xhHm != null  and xhHm != ''"> and XH_HM = #{xhHm}</if>
            <if test="XM != null  and XM != ''"> and XM like concat('%', #{XM}, '%')</if>
            <if test="XWBQBS != null  and XWBQBS != ''"> and XWBQBS = #{XWBQBS}</if>
            <if test="xxscPdbz != null  and xxscPdbz != ''"> and XXSC_PDBZ = #{xxscPdbz}</if>
            <if test="YDDH != null  and YDDH != ''"> and YDDH = #{YDDH}</if>
            <if test="yiZw != null  and yiZw != ''"> and YI_ZW = #{yiZw}</if>
            <if test="YSXTJRZJ != null  and YSXTJRZJ != ''"> and YSXTJRZJ = #{YSXTJRZJ}</if>
            <if test="YWBQBS != null  and YWBQBS != ''"> and YWBQBS = #{YWBQBS}</if>
            <if test="zhijBh != null  and zhijBh != ''"> and ZHIJ_BH = #{zhijBh}</if>
            <if test="zhijMc != null  and zhijMc != ''"> and ZHIJ_MC = #{zhijMc}</if>
            <if test="ZJHM != null  and ZJHM != ''"> and ZJHM = #{ZJHM}</if>
            <if test="ZW != null  and ZW != ''"> and ZW = #{ZW}</if>
            <if test="zzjgDm != null  and zzjgDm != ''"> and ZZJG_DM = #{zzjgDm}</if>
        </where>
    </select>
    
    <select id="selectPoliceInfoByBGDH" parameterType="String" resultMap="PoliceInfoResult">
        <include refid="selectPoliceInfoVo"/>
        where BGDH = #{BGDH}
    </select>
        
    <insert id="insertPoliceInfo" parameterType="com.djhk.common.api.domain.PoliceInfo">
        insert into police_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="BGDH != null">BGDH,</if>
            <if test="bumJzoMc != null">BUM_JZO_MC,</if>
            <if test="bumJzoXxdm02 != null">BUM_JZO_XXDM02,</if>
            <if test="cjgagzRq != null">CJGAGZ_RQ,</if>
            <if test="CJSJ != null">CJSJ,</if>
            <if test="CSRQ != null">CSRQ,</if>
            <if test="CYZJDM != null">CYZJDM,</if>
            <if test="cyzjMc != null">CYZJ_MC,</if>
            <if test="DWMC != null">DWMC,</if>
            <if test="FHXTSJWYBSID != null">FHXTSJWYBSID,</if>
            <if test="GMSFHM != null">GMSFHM,</if>
            <if test="GXSJ != null">GXSJ,</if>
            <if test="JH != null">JH,</if>
            <if test="jxiaDm != null">JXIA_DM,</if>
            <if test="jxiaMc != null">JXIA_MC,</if>
            <if test="kexXxdm02 != null">KEX_XXDM02,</if>
            <if test="MZDM != null">MZDM,</if>
            <if test="MZMZWZ != null">MZMZWZ,</if>
            <if test="nbBh != null">NB_BH,</if>
            <if test="RYZTDM != null">RYZTDM,</if>
            <if test="RYZTMS != null">RYZTMS,</if>
            <if test="SJCJLYBM != null">SJCJLYBM,</if>
            <if test="SJCJLYBM1 != null">SJCJLYBM1,</if>
            <if test="SJCJLYD != null">SJCJLYD,</if>
            <if test="SJCJLYXT != null">SJCJLYXT,</if>
            <if test="SJCJLYXTBZ != null">SJCJLYXTBZ,</if>
            <if test="SJKHSBSF != null">SJKHSBSF,</if>
            <if test="SJMGJBBM != null">SJMGJBBM,</if>
            <if test="XBDM != null">XBDM,</if>
            <if test="XBMZWZ != null">XBMZWZ,</if>
            <if test="xhHm != null">XH_HM,</if>
            <if test="XM != null">XM,</if>
            <if test="XWBQBS != null">XWBQBS,</if>
            <if test="xxscPdbz != null">XXSC_PDBZ,</if>
            <if test="YDDH != null">YDDH,</if>
            <if test="yiZw != null">YI_ZW,</if>
            <if test="YSXTJRZJ != null">YSXTJRZJ,</if>
            <if test="YWBQBS != null">YWBQBS,</if>
            <if test="zhijBh != null">ZHIJ_BH,</if>
            <if test="zhijMc != null">ZHIJ_MC,</if>
            <if test="ZJHM != null">ZJHM,</if>
            <if test="ZW != null">ZW,</if>
            <if test="zzjgDm != null">ZZJG_DM,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="BGDH != null">#{BGDH},</if>
            <if test="bumJzoMc != null">#{bumJzoMc},</if>
            <if test="bumJzoXxdm02 != null">#{bumJzoXxdm02},</if>
            <if test="cjgagzRq != null">#{cjgagzRq},</if>
            <if test="CJSJ != null">#{CJSJ},</if>
            <if test="CSRQ != null">#{CSRQ},</if>
            <if test="CYZJDM != null">#{CYZJDM},</if>
            <if test="cyzjMc != null">#{cyzjMc},</if>
            <if test="DWMC != null">#{DWMC},</if>
            <if test="FHXTSJWYBSID != null">#{FHXTSJWYBSID},</if>
            <if test="GMSFHM != null">#{GMSFHM},</if>
            <if test="GXSJ != null">#{GXSJ},</if>
            <if test="JH != null">#{JH},</if>
            <if test="jxiaDm != null">#{jxiaDm},</if>
            <if test="jxiaMc != null">#{jxiaMc},</if>
            <if test="kexXxdm02 != null">#{kexXxdm02},</if>
            <if test="MZDM != null">#{MZDM},</if>
            <if test="MZMZWZ != null">#{MZMZWZ},</if>
            <if test="nbBh != null">#{nbBh},</if>
            <if test="RYZTDM != null">#{RYZTDM},</if>
            <if test="RYZTMS != null">#{RYZTMS},</if>
            <if test="SJCJLYBM != null">#{SJCJLYBM},</if>
            <if test="SJCJLYBM1 != null">#{SJCJLYBM1},</if>
            <if test="SJCJLYD != null">#{SJCJLYD},</if>
            <if test="SJCJLYXT != null">#{SJCJLYXT},</if>
            <if test="SJCJLYXTBZ != null">#{SJCJLYXTBZ},</if>
            <if test="SJKHSBSF != null">#{SJKHSBSF},</if>
            <if test="SJMGJBBM != null">#{SJMGJBBM},</if>
            <if test="XBDM != null">#{XBDM},</if>
            <if test="XBMZWZ != null">#{XBMZWZ},</if>
            <if test="xhHm != null">#{xhHm},</if>
            <if test="XM != null">#{XM},</if>
            <if test="XWBQBS != null">#{XWBQBS},</if>
            <if test="xxscPdbz != null">#{xxscPdbz},</if>
            <if test="YDDH != null">#{YDDH},</if>
            <if test="yiZw != null">#{yiZw},</if>
            <if test="YSXTJRZJ != null">#{YSXTJRZJ},</if>
            <if test="YWBQBS != null">#{YWBQBS},</if>
            <if test="zhijBh != null">#{zhijBh},</if>
            <if test="zhijMc != null">#{zhijMc},</if>
            <if test="ZJHM != null">#{ZJHM},</if>
            <if test="ZW != null">#{ZW},</if>
            <if test="zzjgDm != null">#{zzjgDm},</if>
         </trim>
    </insert>

    <update id="updatePoliceInfo" parameterType="com.djhk.common.api.domain.PoliceInfo">
        update police_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="bumJzoMc != null">BUM_JZO_MC = #{bumJzoMc},</if>
            <if test="bumJzoXxdm02 != null">BUM_JZO_XXDM02 = #{bumJzoXxdm02},</if>
            <if test="cjgagzRq != null">CJGAGZ_RQ = #{cjgagzRq},</if>
            <if test="CJSJ != null">CJSJ = #{CJSJ},</if>
            <if test="CSRQ != null">CSRQ = #{CSRQ},</if>
            <if test="CYZJDM != null">CYZJDM = #{CYZJDM},</if>
            <if test="cyzjMc != null">CYZJ_MC = #{cyzjMc},</if>
            <if test="DWMC != null">DWMC = #{DWMC},</if>
            <if test="FHXTSJWYBSID != null">FHXTSJWYBSID = #{FHXTSJWYBSID},</if>
            <if test="GMSFHM != null">GMSFHM = #{GMSFHM},</if>
            <if test="GXSJ != null">GXSJ = #{GXSJ},</if>
            <if test="JH != null">JH = #{JH},</if>
            <if test="jxiaDm != null">JXIA_DM = #{jxiaDm},</if>
            <if test="jxiaMc != null">JXIA_MC = #{jxiaMc},</if>
            <if test="kexXxdm02 != null">KEX_XXDM02 = #{kexXxdm02},</if>
            <if test="MZDM != null">MZDM = #{MZDM},</if>
            <if test="MZMZWZ != null">MZMZWZ = #{MZMZWZ},</if>
            <if test="nbBh != null">NB_BH = #{nbBh},</if>
            <if test="RYZTDM != null">RYZTDM = #{RYZTDM},</if>
            <if test="RYZTMS != null">RYZTMS = #{RYZTMS},</if>
            <if test="SJCJLYBM != null">SJCJLYBM = #{SJCJLYBM},</if>
            <if test="SJCJLYBM1 != null">SJCJLYBM1 = #{SJCJLYBM1},</if>
            <if test="SJCJLYD != null">SJCJLYD = #{SJCJLYD},</if>
            <if test="SJCJLYXT != null">SJCJLYXT = #{SJCJLYXT},</if>
            <if test="SJCJLYXTBZ != null">SJCJLYXTBZ = #{SJCJLYXTBZ},</if>
            <if test="SJKHSBSF != null">SJKHSBSF = #{SJKHSBSF},</if>
            <if test="SJMGJBBM != null">SJMGJBBM = #{SJMGJBBM},</if>
            <if test="XBDM != null">XBDM = #{XBDM},</if>
            <if test="XBMZWZ != null">XBMZWZ = #{XBMZWZ},</if>
            <if test="xhHm != null">XH_HM = #{xhHm},</if>
            <if test="XM != null">XM = #{XM},</if>
            <if test="XWBQBS != null">XWBQBS = #{XWBQBS},</if>
            <if test="xxscPdbz != null">XXSC_PDBZ = #{xxscPdbz},</if>
            <if test="YDDH != null">YDDH = #{YDDH},</if>
            <if test="yiZw != null">YI_ZW = #{yiZw},</if>
            <if test="YSXTJRZJ != null">YSXTJRZJ = #{YSXTJRZJ},</if>
            <if test="YWBQBS != null">YWBQBS = #{YWBQBS},</if>
            <if test="zhijBh != null">ZHIJ_BH = #{zhijBh},</if>
            <if test="zhijMc != null">ZHIJ_MC = #{zhijMc},</if>
            <if test="ZJHM != null">ZJHM = #{ZJHM},</if>
            <if test="ZW != null">ZW = #{ZW},</if>
            <if test="zzjgDm != null">ZZJG_DM = #{zzjgDm},</if>
        </trim>
        where BGDH = #{BGDH}
    </update>

    <delete id="deletePoliceInfoByBGDH" parameterType="String">
        delete from police_info where BGDH = #{BGDH}
    </delete>

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