YardMapper.xml 8.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.wlpt.station.manage.mapper.YardMapper">
    <resultMap id="BaseResultMap" type="com.sunyo.wlpt.station.manage.domain.Yard">
        <!--@mbg.generated-->
        <!--@Table yard-->
        <id column="id" jdbcType="VARCHAR" property="id"/>
    <result column="area_code" jdbcType="VARCHAR" property="areaCode"/>
    <result column="stationId" jdbcType="VARCHAR" property="stationId"/>
    <result column="name" jdbcType="VARCHAR" property="name"/>
    <result column="customs_code" jdbcType="INTEGER" property="customsCode"/>
    <result column="org_id" jdbcType="VARCHAR" property="orgId"/>
    <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
    <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
    <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
    <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
    <result column="del_flag" jdbcType="CHAR" property="delFlag"/>
    <result column="stationIdG2" jdbcType="VARCHAR" property="stationIdG2"/>
    </resultMap>
  <sql id="Base_Column_List">
      <!--@mbg.generated-->
      id, area_code, stationId, `name`, customs_code, org_id, create_by, create_date, update_by,
    update_date, remarks, del_flag, stationIdG2
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
      <!--@mbg.generated-->
      select
      <include refid="Base_Column_List"/>
      from yard
      where id = #{id,jdbcType=VARCHAR}
  </select>

<select id="selectByYardName" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from yard
    where name = #{name,jdbcType=VARCHAR}
</select>

<select id="selectList" parameterType="com.sunyo.wlpt.station.manage.domain.Yard" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from yard
</select>
  <select id="selectListByPage" parameterType="com.sunyo.wlpt.station.manage.domain.Yard" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List"/>
      from yard
      <where>
          <!-- name,场站名称 -->
          <if test="name != null and name != ''">
              name = #{name,jdbcType=VARCHAR}
          </if>
          <!-- customsCode,关区代码 -->
          <if test="customsCode != null">
              and customs_code = #{customsCode,jdbcType=INTEGER}
          </if>
      </where>
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
      <!--@mbg.generated-->
      delete
      from yard
      where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.sunyo.wlpt.station.manage.domain.Yard">
      <!--@mbg.generated-->
      insert into yard (id, area_code, stationId,
                        `name`, customs_code, org_id,
                        create_by, create_date, update_by,
                        update_date, remarks, del_flag, stationIdG2)
      values (#{id,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR},
              #{name,jdbcType=VARCHAR}, #{customsCode,jdbcType=INTEGER}, #{orgId,jdbcType=VARCHAR},
              #{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
              #{updateDate,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR},
              #{stationIdG2,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.sunyo.wlpt.station.manage.domain.Yard">
      <!--@mbg.generated-->
      insert into yard
      <trim prefix="(" suffix=")" suffixOverrides=",">
          <if test="id != null">
              id,
          </if>
      <if test="areaCode != null">
          area_code,
      </if>
      <if test="stationId != null">
          stationId,
      </if>
      <if test="name != null">
          `name`,
      </if>
      <if test="customsCode != null">
          customs_code,
      </if>
      <if test="orgId != null">
          org_id,
      </if>
      <if test="createBy != null">
          create_by,
      </if>
      <if test="createDate != null">
          create_date,
      </if>
      <if test="updateBy != null">
          update_by,
      </if>
      <if test="updateDate != null">
          update_date,
      </if>
      <if test="remarks != null">
          remarks,
      </if>
      <if test="delFlag != null">
          del_flag,
      </if>
      <if test="stationIdG2 != null">
          stationIdG2,
      </if>
      </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
        <if test="id != null">
            #{id,jdbcType=VARCHAR},
        </if>
      <if test="areaCode != null">
          #{areaCode,jdbcType=VARCHAR},
      </if>
      <if test="stationId != null">
          #{stationId,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
          #{name,jdbcType=VARCHAR},
      </if>
      <if test="customsCode != null">
          #{customsCode,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
          #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
          #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
          #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
          #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateDate != null">
          #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
          #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
          #{delFlag,jdbcType=CHAR},
      </if>
      <if test="stationIdG2 != null">
          #{stationIdG2,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.station.manage.domain.Yard">
      <!--@mbg.generated-->
      update yard
      <set>
          <if test="areaCode != null">
              area_code = #{areaCode,jdbcType=VARCHAR},
          </if>
      <if test="stationId != null">
          stationId = #{stationId,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
          `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="customsCode != null">
          customs_code = #{customsCode,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
          org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
          create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
          create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
          update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateDate != null">
          update_date = #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
          remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
          del_flag = #{delFlag,jdbcType=CHAR},
      </if>
      <if test="stationIdG2 != null">
          stationIdG2 = #{stationIdG2,jdbcType=VARCHAR}
      </if>
      </set>
      where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.station.manage.domain.Yard">
      <!--@mbg.generated-->
      update yard
      set area_code    = #{areaCode,jdbcType=VARCHAR},
          stationId    = #{stationId,jdbcType=VARCHAR},
          `name`       = #{name,jdbcType=VARCHAR},
          customs_code = #{customsCode,jdbcType=INTEGER},
          org_id       = #{orgId,jdbcType=VARCHAR},
          create_by    = #{createBy,jdbcType=VARCHAR},
          create_date  = #{createDate,jdbcType=TIMESTAMP},
          update_by    = #{updateBy,jdbcType=VARCHAR},
          update_date  = #{updateDate,jdbcType=TIMESTAMP},
          remarks      = #{remarks,jdbcType=VARCHAR},
          del_flag     = #{delFlag,jdbcType=CHAR},
          stationIdG2  = #{stationIdG2,jdbcType=VARCHAR}
      where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>