<?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.ruoyi.system.mapper.grid.GridCompanyEconomyMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.grid.GridCompanyEconomy">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="company_name" jdbcType="VARCHAR" property="companyName" />
    <result column="credit_code" jdbcType="VARCHAR" property="creditCode" />
    <result column="sale" jdbcType="VARCHAR" property="sale" />
    <result column="tax" jdbcType="VARCHAR" property="tax" />
    <result column="production" jdbcType="VARCHAR" property="production" />
    <result column="belong_time" jdbcType="VARCHAR" property="belongTime" />
    <result column="create_time" jdbcType="VARCHAR" property="createTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, company_name, credit_code, sale, tax, production, belong_time, create_time
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from grid_company_economy
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from grid_company_economy
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from grid_company_economy
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyExample">
    delete from grid_company_economy
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomy">
    insert into grid_company_economy (id, company_name, credit_code,
      sale, tax, production,
      belong_time, create_time)
    values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{creditCode,jdbcType=VARCHAR},
      #{sale,jdbcType=VARCHAR}, #{tax,jdbcType=VARCHAR}, #{production,jdbcType=VARCHAR},
      #{belongTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomy">
    insert into grid_company_economy
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="companyName != null">
        company_name,
      </if>
      <if test="creditCode != null">
        credit_code,
      </if>
      <if test="sale != null">
        sale,
      </if>
      <if test="tax != null">
        tax,
      </if>
      <if test="production != null">
        production,
      </if>
      <if test="belongTime != null">
        belong_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyName != null">
        #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="creditCode != null">
        #{creditCode,jdbcType=VARCHAR},
      </if>
      <if test="sale != null">
        #{sale,jdbcType=VARCHAR},
      </if>
      <if test="tax != null">
        #{tax,jdbcType=VARCHAR},
      </if>
      <if test="production != null">
        #{production,jdbcType=VARCHAR},
      </if>
      <if test="belongTime != null">
        #{belongTime,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyExample" resultType="java.lang.Long">
    select count(*) from grid_company_economy
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update grid_company_economy
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.companyName != null">
        company_name = #{record.companyName,jdbcType=VARCHAR},
      </if>
      <if test="record.creditCode != null">
        credit_code = #{record.creditCode,jdbcType=VARCHAR},
      </if>
      <if test="record.sale != null">
        sale = #{record.sale,jdbcType=VARCHAR},
      </if>
      <if test="record.tax != null">
        tax = #{record.tax,jdbcType=VARCHAR},
      </if>
      <if test="record.production != null">
        production = #{record.production,jdbcType=VARCHAR},
      </if>
      <if test="record.belongTime != null">
        belong_time = #{record.belongTime,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update grid_company_economy
    set id = #{record.id,jdbcType=VARCHAR},
      company_name = #{record.companyName,jdbcType=VARCHAR},
      credit_code = #{record.creditCode,jdbcType=VARCHAR},
      sale = #{record.sale,jdbcType=VARCHAR},
      tax = #{record.tax,jdbcType=VARCHAR},
      production = #{record.production,jdbcType=VARCHAR},
      belong_time = #{record.belongTime,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomy">
    update grid_company_economy
    <set>
      <if test="companyName != null">
        company_name = #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="creditCode != null">
        credit_code = #{creditCode,jdbcType=VARCHAR},
      </if>
      <if test="sale != null">
        sale = #{sale,jdbcType=VARCHAR},
      </if>
      <if test="tax != null">
        tax = #{tax,jdbcType=VARCHAR},
      </if>
      <if test="production != null">
        production = #{production,jdbcType=VARCHAR},
      </if>
      <if test="belongTime != null">
        belong_time = #{belongTime,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomy">
    update grid_company_economy
    set company_name = #{companyName,jdbcType=VARCHAR},
      credit_code = #{creditCode,jdbcType=VARCHAR},
      sale = #{sale,jdbcType=VARCHAR},
      tax = #{tax,jdbcType=VARCHAR},
      production = #{production,jdbcType=VARCHAR},
      belong_time = #{belongTime,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
