<?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.railway.business.catenary.mapper.BusJlgzPicMapper">

  <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJlgzPic">
    <result column="id" property="id"/>
    <result column="jlgz_id" property="jlgzId"/>
    <result column="url" property="url"/>
  </resultMap>

  <sql id="Base_Column_List">
    id,
    jlgz_id,
    url
  </sql>

  <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJlgzPic">

    INSERT INTO base_jlgz_pic
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test='null != jlgzId'>
        jlgz_id,
      </if>
      <if test='null != url'>
        url
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test='null != jlgzId'>
        #{jlgzId},
      </if>
      <if test='null != url'>
        #{url}
      </if>
    </trim>
  </insert>

  <delete id="delete">
    delete from base_jlgz_pic
    WHERE id = #{id}
  </delete>

  <delete id="deleteByJlgzId">
    delete from base_jlgz_pic
    where jlgz_id = #{jlgzId}
  </delete>

  <update id="update" parameterType="com.railway.business.catenary.domain.BusJlgzPic">
    UPDATE base_jlgz_pic
    <set>
      <if test='null != jlgzId'>jlgz_id = #{jlgzId},</if>
      <if test='null != url'>url = #{url}</if>
    </set>
    WHERE id = #{id}
  </update>


  <select id="getInfo" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM base_jlgz_pic
    WHERE id = #{id}
  </select>

  <select id="getList" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM base_jlgz_pic
    <where>
      <if test="jlgzId!=null and jlgzId!=''">
        and jlgz_id=#{jlgzId}
      </if>
      <if test="url!=null and url!=''">
        and url=#{url}
      </if>
    </where>
  </select>

</mapper>