IMStoreMapper.xml 1.8 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.sibu.orderHelper.integral.web.dao.IMStoreDao">
  <resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMStoreBean">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="contact" jdbcType="VARCHAR" property="contact" />
    <result column="contact_phone" jdbcType="VARCHAR" property="contactPhone" />
    <result column="freight_remark" jdbcType="VARCHAR" property="freightRemark"/>
    <result column="address" jdbcType="VARCHAR" property="address"/>
    <result column="head_img" jdbcType="VARCHAR" property="headImg"/>
  </resultMap>

  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    id, contact, contact_phone,name,freight_remark,address,head_img
    from im_supplier
    where id = #{id}
  </select>

  <update id="updateByPrimaryKeySelective" parameterType="com.sibu.orderHelper.integral.model.IMStoreBean">
    update im_supplier
    <set>
      <if test="contact != null">
        contact = #{contact,jdbcType=VARCHAR},
      </if>
      <if test="contactPhone != null">
        contact_phone = #{contactPhone,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="freightRemark != null">
        freight_remark = #{freightRemark,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="headImg != null">
        head_img = #{headImg,jdbcType=VARCHAR},
      </if>
      create_dt = NOW()
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>

</mapper>