COMPANYUSERMapper.xml 7.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.tianbo.analysis.dao.COMPANYUSERMapper">
  <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.COMPANYUSER">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="CROP_CODE" jdbcType="VARCHAR" property="cropCode" />
    <result column="PASSWORD" jdbcType="VARCHAR" property="password" />
    <result column="CUSTOMS_CODE" jdbcType="VARCHAR" property="customsCode" />
    <result column="ORG_CODE" jdbcType="VARCHAR" property="orgCode" />
    <result column="FULL_NAME" jdbcType="VARCHAR" property="fullName" />
    <result column="ADDR_CO" jdbcType="VARCHAR" property="addrCo" />
    <result column="LAW_MAN" jdbcType="VARCHAR" property="lawMan" />
    <result column="CONTAC_CO" jdbcType="VARCHAR" property="contacCo" />
    <result column="TEL_CO" jdbcType="VARCHAR" property="telCo" />
    <result column="CROP_TYPE" jdbcType="VARCHAR" property="cropType" />
    <result column="ZIP_CODE" jdbcType="VARCHAR" property="zipCode" />
    <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, CROP_CODE, PASSWORD, CUSTOMS_CODE, ORG_CODE, FULL_NAME, ADDR_CO, LAW_MAN, CONTAC_CO,
    TEL_CO, CROP_TYPE, ZIP_CODE, CREATE_DATE
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from COMPANYUSER
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <select id="selectByUsername" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from COMPANYUSER
    where CROP_CODE = #{cropCode,jdbcType=VARCHAR}
  </select>
  <select id="selectByIdAndName" parameterType="com.tianbo.analysis.model.COMPANYUSER" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from COMPANYUSER
    where ID = #{id,jdbcType=VARCHAR}
    and CROP_CODE = #{cropCode,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from COMPANYUSER
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.tianbo.analysis.model.COMPANYUSER">
    insert into COMPANYUSER (ID, CROP_CODE, PASSWORD,
      CUSTOMS_CODE, ORG_CODE, FULL_NAME,
      ADDR_CO, LAW_MAN, CONTAC_CO,
      TEL_CO, CROP_TYPE, ZIP_CODE,
      CREATE_DATE)
    values (#{id,jdbcType=VARCHAR}, #{cropCode,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
      #{customsCode,jdbcType=VARCHAR}, #{orgCode,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR},
      #{addrCo,jdbcType=VARCHAR}, #{lawMan,jdbcType=VARCHAR}, #{contacCo,jdbcType=VARCHAR},
      #{telCo,jdbcType=VARCHAR}, #{cropType,jdbcType=VARCHAR}, #{zipCode,jdbcType=VARCHAR},
      #{createDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.analysis.model.COMPANYUSER">
    insert into COMPANYUSER
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="cropCode != null">
        CROP_CODE,
      </if>
      <if test="password != null">
        PASSWORD,
      </if>
      <if test="customsCode != null">
        CUSTOMS_CODE,
      </if>
      <if test="orgCode != null">
        ORG_CODE,
      </if>
      <if test="fullName != null">
        FULL_NAME,
      </if>
      <if test="addrCo != null">
        ADDR_CO,
      </if>
      <if test="lawMan != null">
        LAW_MAN,
      </if>
      <if test="contacCo != null">
        CONTAC_CO,
      </if>
      <if test="telCo != null">
        TEL_CO,
      </if>
      <if test="cropType != null">
        CROP_TYPE,
      </if>
      <if test="zipCode != null">
        ZIP_CODE,
      </if>
      <if test="createDate != null">
        CREATE_DATE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="cropCode != null">
        #{cropCode,jdbcType=VARCHAR},
      </if>
      <if test="password != null">
        #{password,jdbcType=VARCHAR},
      </if>
      <if test="customsCode != null">
        #{customsCode,jdbcType=VARCHAR},
      </if>
      <if test="orgCode != null">
        #{orgCode,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="addrCo != null">
        #{addrCo,jdbcType=VARCHAR},
      </if>
      <if test="lawMan != null">
        #{lawMan,jdbcType=VARCHAR},
      </if>
      <if test="contacCo != null">
        #{contacCo,jdbcType=VARCHAR},
      </if>
      <if test="telCo != null">
        #{telCo,jdbcType=VARCHAR},
      </if>
      <if test="cropType != null">
        #{cropType,jdbcType=VARCHAR},
      </if>
      <if test="zipCode != null">
        #{zipCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.COMPANYUSER">
    update COMPANYUSER
    <set>
      <if test="cropCode != null">
        CROP_CODE = #{cropCode,jdbcType=VARCHAR},
      </if>
      <if test="password != null">
        PASSWORD = #{password,jdbcType=VARCHAR},
      </if>
      <if test="customsCode != null">
        CUSTOMS_CODE = #{customsCode,jdbcType=VARCHAR},
      </if>
      <if test="orgCode != null">
        ORG_CODE = #{orgCode,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        FULL_NAME = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="addrCo != null">
        ADDR_CO = #{addrCo,jdbcType=VARCHAR},
      </if>
      <if test="lawMan != null">
        LAW_MAN = #{lawMan,jdbcType=VARCHAR},
      </if>
      <if test="contacCo != null">
        CONTAC_CO = #{contacCo,jdbcType=VARCHAR},
      </if>
      <if test="telCo != null">
        TEL_CO = #{telCo,jdbcType=VARCHAR},
      </if>
      <if test="cropType != null">
        CROP_TYPE = #{cropType,jdbcType=VARCHAR},
      </if>
      <if test="zipCode != null">
        ZIP_CODE = #{zipCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.analysis.model.COMPANYUSER">
    update COMPANYUSER
    set CROP_CODE = #{cropCode,jdbcType=VARCHAR},
      PASSWORD = #{password,jdbcType=VARCHAR},
      CUSTOMS_CODE = #{customsCode,jdbcType=VARCHAR},
      ORG_CODE = #{orgCode,jdbcType=VARCHAR},
      FULL_NAME = #{fullName,jdbcType=VARCHAR},
      ADDR_CO = #{addrCo,jdbcType=VARCHAR},
      LAW_MAN = #{lawMan,jdbcType=VARCHAR},
      CONTAC_CO = #{contacCo,jdbcType=VARCHAR},
      TEL_CO = #{telCo,jdbcType=VARCHAR},
      CROP_TYPE = #{cropType,jdbcType=VARCHAR},
      ZIP_CODE = #{zipCode,jdbcType=VARCHAR},
      CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
</mapper>