Newer
Older
huludao / src / main / resources / mapper / WarnConfigWaterLeverDao.xml
<?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.newfiber.api.pc.dao.WarnConfigWaterLeverDao" >
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.entity.WarnConfigWaterLever" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="st_code" property="stCode" jdbcType="VARCHAR" />
    <result column="st_name" property="stName" jdbcType="VARCHAR" />
    <result column="warn_water_level" property="warnWaterLevel" jdbcType="TINYINT" />
    <result column="warn_water_level_desc" property="warnWaterLevelDesc" jdbcType="VARCHAR" />
    <result column="water_type" property="waterType" jdbcType="TINYINT" />
    <result column="warn_type" property="warnType" jdbcType="TINYINT" />
    <result column="warn_type_desc" property="warnTypeDesc" jdbcType="VARCHAR" />
    <result column="compare_way" property="compareWay" jdbcType="VARCHAR" />
    <result column="compare_way_desc" property="compareWayDesc" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="platform_code" property="platformCode" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>

  <sql id="Base_Column_List" >
    id, st_code, st_name, warn_water_level, warn_water_level_desc, water_type, warn_type,
    warn_type_desc, compare_way, compare_way_desc, create_time, platform_code, update_time
  </sql>

  <update id="updateBySelective" parameterType="com.newfiber.api.pc.model.entity.WarnConfigWaterLever" >
    update warn_config_water_lever
    <set >
      <if test="stName != null" >
        st_name = #{stName,jdbcType=VARCHAR},
      </if>
      <if test="warnWaterLevel != null" >
        warn_water_level = #{warnWaterLevel,jdbcType=TINYINT},
      </if>
      <if test="warnWaterLevelDesc != null" >
        warn_water_level_desc = #{warnWaterLevelDesc,jdbcType=VARCHAR},
      </if>
      <if test="waterType != null" >
        water_type = #{waterType,jdbcType=TINYINT},
      </if>
      <if test="warnTypeDesc != null" >
        warn_type_desc = #{warnTypeDesc,jdbcType=VARCHAR},
      </if>
      <if test="compareWay != null" >
        compare_way = #{compareWay,jdbcType=VARCHAR},
      </if>
      <if test="compareWayDesc != null" >
        compare_way_desc = #{compareWayDesc,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="platformCode != null" >
        platform_code = #{platformCode,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where st_code = #{stCode,jdbcType=VARCHAR} and warn_type = #{warnType,jdbcType=TINYINT}
  </update>

  <!--<update id="updateById" parameterType="com.newfiber.warnalarm.core.entity.WarnConfigWaterLever" >
    update warn_config_water_lever
    <set >
      <if test="stName != null" >
        st_name = #{stName,jdbcType=VARCHAR},
      </if>
      <if test="stCode != null" >
        st_code = #{stCode,jdbcType=VARCHAR},
      </if>
      <if test="warnWaterLevel != null" >
        warn_water_level = #{warnWaterLevel,jdbcType=TINYINT},
      </if>
      <if test="warnWaterLevelDesc != null" >
        warn_water_level_desc = #{warnWaterLevelDesc,jdbcType=VARCHAR},
      </if>
      <if test="waterType != null" >
        water_type = #{waterType,jdbcType=TINYINT},
      </if>
      <if test="warnType != null" >
        warn_type = #{warnType,jdbcType=TINYINT},
      </if>
      <if test="warnTypeDesc != null" >
        warn_type_desc = #{warnTypeDesc,jdbcType=VARCHAR},
      </if>
      <if test="compareWay != null" >
        compare_way = #{compareWay,jdbcType=VARCHAR},
      </if>
      <if test="compareWayDesc != null" >
        compare_way_desc = #{compareWayDesc,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="platformCode != null" >
        platform_code = #{platformCode,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>-->

  <select id="queryWaterLeverWarnConfig" resultType="com.newfiber.api.pc.model.entity.WarnConfigWaterLever">
    select <include refid="Base_Column_List"/> from warn_config_water_lever where st_code = #{stCode,jdbcType=VARCHAR}
  </select>


  <select id="warnConfigWaterByStCodes" resultType="com.newfiber.api.pc.model.entity.WarnConfigWaterLever">
    select <include refid="Base_Column_List"/> from warn_config_water_lever
    where st_code in
    <foreach item="item" index="index" collection="stCodeList" open="(" separator="," close=")">
      #{item,jdbcType=VARCHAR}
    </foreach>
  </select>

</mapper>