InformWaterMapper.xml 2.1 KB
<?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.sunyo.energy.location.dao.InformWaterMapper" >
  <resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.InformWater" >
    <result column="inform_money" property="informMoney" jdbcType="VARCHAR" />
    <result column="inform_phone" property="informPhone" jdbcType="VARCHAR" />
    <result column="room_name" property="roomName" jdbcType="VARCHAR" />
    <result column="wm_id" property="wmId" jdbcType="VARCHAR" />
    <result column="id" property="id" jdbcType="INTEGER" />
  </resultMap>

  <select id="selectAll" resultMap="BaseResultMap">
    select * from inform_water
  </select>

  <insert id="insert" parameterType="com.sunyo.energy.location.model.InformWater" >
    insert into inform_water (inform_money, inform_phone, room_name, 
      wm_id, id)
    values (#{informMoney,jdbcType=VARCHAR}, #{informPhone,jdbcType=VARCHAR}, #{roomName,jdbcType=VARCHAR}, 
      #{wmId,jdbcType=VARCHAR}, #{id,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.InformWater" >
    insert into inform_water
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="informMoney != null" >
        inform_money,
      </if>
      <if test="informPhone != null" >
        inform_phone,
      </if>
      <if test="roomName != null" >
        room_name,
      </if>
      <if test="wmId != null" >
        wm_id,
      </if>
      <if test="id != null" >
        id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="informMoney != null" >
        #{informMoney,jdbcType=VARCHAR},
      </if>
      <if test="informPhone != null" >
        #{informPhone,jdbcType=VARCHAR},
      </if>
      <if test="roomName != null" >
        #{roomName,jdbcType=VARCHAR},
      </if>
      <if test="wmId != null" >
        #{wmId,jdbcType=VARCHAR},
      </if>
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
</mapper>