<?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.srs.comprehensive.mapper.Gxsdxy01ZzjgMapper">

    <resultMap type="com.srs.comprehensive.domain.Gxsdxy01Zzjg" id="Gxsdxy01ZzjgMap">
        <result property="bmbh" column="BMBH" jdbcType="VARCHAR"/>
        <result property="bmbhParent" column="BMBH_PARENT" jdbcType="VARCHAR"/>
        <result property="bmmc" column="BMMC" jdbcType="VARCHAR"/>
        <result property="bmjc" column="BMJC" jdbcType="VARCHAR"/>
        <result property="bmcj" column="BMCJ" jdbcType="INTEGER"/>
        <result property="bmpxh" column="BMPXH" jdbcType="VARCHAR"/>
        <result property="inTime" column="IN_TIME" jdbcType="TIMESTAMP"/>
        <result property="upTime" column="UP_TIME" jdbcType="TIMESTAMP"/>
        <result property="readTime" column="read_time" jdbcType="TIMESTAMP"/>
        <result property="readStatus" column="read_status" jdbcType="VARCHAR"/>
    </resultMap>

    <!--查询所有-->
    <select id="queryAll" resultMap="Gxsdxy01ZzjgMap">
        select BMBH,
               BMBH_PARENT,
               BMMC,
               BMJC,
               BMCJ,
               BMPXH,
               IN_TIME,
               UP_TIME,
               read_time,
               read_status
        from xgxt_iwh.gxsdxy_01_zzjg
        <where>
            <if test="bmbh != null and bmbh != ''">
                and BMBH = #{bmbh}
            </if>
            <if test="bmbhParent != null and bmbhParent != ''">
                and BMBH_PARENT = #{bmbhParent}
            </if>
            <if test="bmmc != null and bmmc != ''">
                and BMMC = #{bmmc}
            </if>
            <if test="bmjc != null and bmjc != ''">
                and BMJC = #{bmjc}
            </if>
            <if test="bmcj != null">
                and BMCJ = #{bmcj}
            </if>
            <if test="bmpxh != null and bmpxh != ''">
                and BMPXH = #{bmpxh}
            </if>
            <if test="inTime != null">
                and IN_TIME = #{inTime}
            </if>
            <if test="upTime != null">
                and UP_TIME = #{upTime}
            </if>
            <if test="readTime != null">
                and read_time = #{readTime}
            </if>
            <if test="readStatus != null and readStatus != ''">
                and read_status = #{readStatus}
            </if>
        </where>
    </select>

  <select id="selectDeptByName" resultMap="Gxsdxy01ZzjgMap">
      SELECT * FROM xgxt_iwh.gxsdxy_01_zzjg WHERE BMMC =#{name} and BMBH_PARENT = 1160804
  </select>


    <!--通过主键修改数据-->
    <update id="update">
        update xgxt_iwh.gxsdxy_01_zzjg
        <set>
            <if test="bmbhParent != null and bmbhParent != ''">
                BMBH_PARENT = #{bmbhParent},
            </if>
            <if test="bmmc != null and bmmc != ''">
                BMMC = #{bmmc},
            </if>
            <if test="bmjc != null and bmjc != ''">
                BMJC = #{bmjc},
            </if>
            <if test="bmcj != null">
                BMCJ = #{bmcj},
            </if>
            <if test="bmpxh != null and bmpxh != ''">
                BMPXH = #{bmpxh},
            </if>
            <if test="inTime != null">
                IN_TIME = #{inTime},
            </if>
            <if test="upTime != null">
                UP_TIME = #{upTime},
            </if>
            <if test="readTime != null">
                read_time = #{readTime},
            </if>
            <if test="readStatus != null and readStatus != ''">
                read_status = #{readStatus},
            </if>
        </set>
        where  BMBH = #{bmbh},
    </update>





</mapper>


