<?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.GridCompanyEconomyInfoMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
    <result column="sale" jdbcType="DECIMAL" property="sale" />
    <result column="tax" jdbcType="DECIMAL" property="tax" />
    <result column="per_mu" jdbcType="DECIMAL" property="perMu" />
    <result column="year" jdbcType="VARCHAR" property="year" />
    <result column="is_valid" jdbcType="VARCHAR" property="isValid" />
    <result column="create_time" jdbcType="VARCHAR" property="createTime" />
    <result column="year_sales" jdbcType="VARCHAR" property="yearSales" />
    <result column="year_taxes" jdbcType="VARCHAR" property="yearTaxes" />
  </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_id, sale, tax, per_mu, year, is_valid, create_time, year_sales, year_taxes
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from grid_company_economy_info
    <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_info
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from grid_company_economy_info
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample">
    delete from grid_company_economy_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
    insert into grid_company_economy_info (id, company_id, sale,
      tax, per_mu, year,
      is_valid, create_time, year_sales, year_taxes)
    values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{sale,jdbcType=DECIMAL}, 
      #{tax,jdbcType=DECIMAL}, #{perMu,jdbcType=DECIMAL}, #{year,jdbcType=VARCHAR},
      #{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}
      , #{yearSales,jdbcType=VARCHAR}, #{yearTaxes,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
    insert into grid_company_economy_info
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="sale != null">
        sale,
      </if>
      <if test="tax != null">
        tax,
      </if>
      <if test="perMu != null">
        per_mu,
      </if>
      <if test="year != null">
        year,
      </if>
      <if test="isValid != null">
        is_valid,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="yearSales != null">
        year_sales,
      </if>
      <if test="yearTaxes != null">
        year_taxes,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="sale != null">
        #{sale,jdbcType=DECIMAL},
      </if>
      <if test="tax != null">
        #{tax,jdbcType=DECIMAL},
      </if>
      <if test="perMu != null">
        #{perMu,jdbcType=DECIMAL},
      </if>
      <if test="year != null">
        #{year,jdbcType=VARCHAR},
      </if>
      <if test="isValid != null">
        #{isValid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="yearSales != null">
        #{yearSales,jdbcType=VARCHAR},
      </if>
      <if test="yearTaxes != null">
        #{yearTaxes,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultType="java.lang.Long">
    select count(*) from grid_company_economy_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update grid_company_economy_info
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=VARCHAR},
      </if>
      <if test="record.sale != null">
        sale = #{record.sale,jdbcType=DECIMAL},
      </if>
      <if test="record.tax != null">
        tax = #{record.tax,jdbcType=DECIMAL},
      </if>
      <if test="record.perMu != null">
        per_mu = #{record.perMu,jdbcType=DECIMAL},
      </if>
      <if test="record.year != null">
        year = #{record.year,jdbcType=VARCHAR},
      </if>
      <if test="record.isValid != null">
        is_valid = #{record.isValid,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=VARCHAR},
      </if>
      <if test="record.yearSales != null">
        year_sales = #{record.yearSales,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        year_taxes = #{record.yearTaxes,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_info
    set id = #{record.id,jdbcType=VARCHAR},
      company_id = #{record.companyId,jdbcType=VARCHAR},
      sale = #{record.sale,jdbcType=DECIMAL},
      tax = #{record.tax,jdbcType=DECIMAL},
      per_mu = #{record.perMu,jdbcType=DECIMAL},
      year = #{record.year,jdbcType=VARCHAR},
      is_valid = #{record.isValid,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=VARCHAR},
      year_sales = #{record.yearSales,jdbcType=VARCHAR},
      year_taxes = #{record.yearTaxes,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
    update grid_company_economy_info
    <set>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="sale != null">
        sale = #{sale,jdbcType=DECIMAL},
      </if>
      <if test="tax != null">
        tax = #{tax,jdbcType=DECIMAL},
      </if>
      <if test="perMu != null">
        per_mu = #{perMu,jdbcType=DECIMAL},
      </if>
      <if test="year != null">
        year = #{year,jdbcType=VARCHAR},
      </if>
      <if test="isValid != null">
        is_valid = #{isValid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="record.yearSales != null">
        year_sales = #{yearSales,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        year_taxes = #{yearTaxes,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
    update grid_company_economy_info
    set company_id = #{companyId,jdbcType=VARCHAR},
      sale = #{sale,jdbcType=DECIMAL},
      tax = #{tax,jdbcType=DECIMAL},
      per_mu = #{perMu,jdbcType=DECIMAL},
      year = #{year,jdbcType=VARCHAR},
      is_valid = #{isValid,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR},
        year_sales = #{yearSales,jdbcType=VARCHAR},
        year_taxes = #{yearTaxes,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>