|
@@ -0,0 +1,145 @@
|
|
|
+<?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.enteprise.industry_run.mapper.EnterpriseBaseDataTotalMapper">
|
|
|
+
|
|
|
+ <resultMap type="EnterpriseBaseDataTotal" id="EnterpriseBaseDataTotalResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="enterpriseName" column="enterprise_name" />
|
|
|
+ <result property="location" column="location" />
|
|
|
+ <result property="industryName" column="industry_name" />
|
|
|
+ <result property="code" column="code" />
|
|
|
+ <result property="mainBusiness" column="main_business" />
|
|
|
+ <result property="landArea" column="land_area" />
|
|
|
+ <result property="totalIndustrialValue" column="total_industrial_value" />
|
|
|
+ <result property="gdp" column="gdp" />
|
|
|
+ <result property="taxableIncome" column="taxable_income" />
|
|
|
+ <result property="paidTax" column="paid_tax" />
|
|
|
+ <result property="mainBusinessIncome" column="main_business_income" />
|
|
|
+ <result property="employeeNumber" column="employee_number" />
|
|
|
+ <result property="profit" column="profit" />
|
|
|
+ <result property="ownerEquity" column="owner_equity" />
|
|
|
+ <result property="funding" column="funding" />
|
|
|
+ <result property="energyConsume" column="energy_consume" />
|
|
|
+ <result property="powerConsume" column="power_consume" />
|
|
|
+ <result property="year" column="year" />
|
|
|
+ <result property="season" column="season" />
|
|
|
+ <result property="month" column="month" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectEnterpriseBaseDataTotalVo">
|
|
|
+ select id, enterprise_name, location, industry_name, code, main_business, land_area, total_industrial_value, gdp, taxable_income, paid_tax, main_business_income, employee_number, profit, owner_equity, funding, energy_consume, power_consume, year, season, month from enterprise_base_data_total
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectEnterpriseBaseDataTotalList" parameterType="EnterpriseBaseDataTotal" resultMap="EnterpriseBaseDataTotalResult">
|
|
|
+ <include refid="selectEnterpriseBaseDataTotalVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
|
|
+ <if test="location != null and location != ''"> and location = #{location}</if>
|
|
|
+ <if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
+ <if test="totalIndustrialValue != null "> and total_industrial_value = #{totalIndustrialValue}</if>
|
|
|
+ <if test="taxableIncome != null "> and taxable_income = #{taxableIncome}</if>
|
|
|
+ <if test="paidTax != null "> and paid_tax = #{paidTax}</if>
|
|
|
+ <if test="funding != null "> and funding = #{funding}</if>
|
|
|
+ <if test="energyConsume != null "> and energy_consume = #{energyConsume}</if>
|
|
|
+ <if test="powerConsume != null "> and power_consume = #{powerConsume}</if>
|
|
|
+ <if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
+ <if test="season != null and season != ''"> and season = #{season}</if>
|
|
|
+ <if test="month != null and month != ''"> and month = #{month}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectEnterpriseBaseDataTotalByEnterpriseName" parameterType="String" resultMap="EnterpriseBaseDataTotalResult">
|
|
|
+ <include refid="selectEnterpriseBaseDataTotalVo"/>
|
|
|
+ where enterprise_name = #{enterpriseName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertEnterpriseBaseDataTotal" parameterType="EnterpriseBaseDataTotal">
|
|
|
+ insert into enterprise_base_data_total
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="enterpriseName != null">enterprise_name,</if>
|
|
|
+ <if test="location != null">location,</if>
|
|
|
+ <if test="industryName != null and industryName != ''">industry_name,</if>
|
|
|
+ <if test="code != null">code,</if>
|
|
|
+ <if test="mainBusiness != null">main_business,</if>
|
|
|
+ <if test="landArea != null">land_area,</if>
|
|
|
+ <if test="totalIndustrialValue != null">total_industrial_value,</if>
|
|
|
+ <if test="gdp != null">gdp,</if>
|
|
|
+ <if test="taxableIncome != null">taxable_income,</if>
|
|
|
+ <if test="paidTax != null">paid_tax,</if>
|
|
|
+ <if test="mainBusinessIncome != null">main_business_income,</if>
|
|
|
+ <if test="employeeNumber != null">employee_number,</if>
|
|
|
+ <if test="profit != null">profit,</if>
|
|
|
+ <if test="ownerEquity != null">owner_equity,</if>
|
|
|
+ <if test="funding != null">funding,</if>
|
|
|
+ <if test="energyConsume != null">energy_consume,</if>
|
|
|
+ <if test="powerConsume != null">power_consume,</if>
|
|
|
+ <if test="year != null">year,</if>
|
|
|
+ <if test="season != null and season != ''">season,</if>
|
|
|
+ <if test="month != null">month,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="enterpriseName != null">#{enterpriseName},</if>
|
|
|
+ <if test="location != null">#{location},</if>
|
|
|
+ <if test="industryName != null and industryName != ''">#{industryName},</if>
|
|
|
+ <if test="code != null">#{code},</if>
|
|
|
+ <if test="mainBusiness != null">#{mainBusiness},</if>
|
|
|
+ <if test="landArea != null">#{landArea},</if>
|
|
|
+ <if test="totalIndustrialValue != null">#{totalIndustrialValue},</if>
|
|
|
+ <if test="gdp != null">#{gdp},</if>
|
|
|
+ <if test="taxableIncome != null">#{taxableIncome},</if>
|
|
|
+ <if test="paidTax != null">#{paidTax},</if>
|
|
|
+ <if test="mainBusinessIncome != null">#{mainBusinessIncome},</if>
|
|
|
+ <if test="employeeNumber != null">#{employeeNumber},</if>
|
|
|
+ <if test="profit != null">#{profit},</if>
|
|
|
+ <if test="ownerEquity != null">#{ownerEquity},</if>
|
|
|
+ <if test="funding != null">#{funding},</if>
|
|
|
+ <if test="energyConsume != null">#{energyConsume},</if>
|
|
|
+ <if test="powerConsume != null">#{powerConsume},</if>
|
|
|
+ <if test="year != null">#{year},</if>
|
|
|
+ <if test="season != null and season != ''">#{season},</if>
|
|
|
+ <if test="month != null">#{month},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateEnterpriseBaseDataTotal" parameterType="EnterpriseBaseDataTotal">
|
|
|
+ update enterprise_base_data_total
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="id != null">id = #{id},</if>
|
|
|
+ <if test="location != null">location = #{location},</if>
|
|
|
+ <if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
|
|
|
+ <if test="code != null">code = #{code},</if>
|
|
|
+ <if test="mainBusiness != null">main_business = #{mainBusiness},</if>
|
|
|
+ <if test="landArea != null">land_area = #{landArea},</if>
|
|
|
+ <if test="totalIndustrialValue != null">total_industrial_value = #{totalIndustrialValue},</if>
|
|
|
+ <if test="gdp != null">gdp = #{gdp},</if>
|
|
|
+ <if test="taxableIncome != null">taxable_income = #{taxableIncome},</if>
|
|
|
+ <if test="paidTax != null">paid_tax = #{paidTax},</if>
|
|
|
+ <if test="mainBusinessIncome != null">main_business_income = #{mainBusinessIncome},</if>
|
|
|
+ <if test="employeeNumber != null">employee_number = #{employeeNumber},</if>
|
|
|
+ <if test="profit != null">profit = #{profit},</if>
|
|
|
+ <if test="ownerEquity != null">owner_equity = #{ownerEquity},</if>
|
|
|
+ <if test="funding != null">funding = #{funding},</if>
|
|
|
+ <if test="energyConsume != null">energy_consume = #{energyConsume},</if>
|
|
|
+ <if test="powerConsume != null">power_consume = #{powerConsume},</if>
|
|
|
+ <if test="year != null">year = #{year},</if>
|
|
|
+ <if test="season != null and season != ''">season = #{season},</if>
|
|
|
+ <if test="month != null">month = #{month},</if>
|
|
|
+ </trim>
|
|
|
+ where enterprise_name = #{enterpriseName}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteEnterpriseBaseDataTotalByEnterpriseName" parameterType="String">
|
|
|
+ delete from enterprise_base_data_total where enterprise_name = #{enterpriseName}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteEnterpriseBaseDataTotalByEnterpriseNames" parameterType="String">
|
|
|
+ delete from enterprise_base_data_total where enterprise_name in
|
|
|
+ <foreach item="enterpriseName" collection="array" open="(" separator="," close=")">
|
|
|
+ #{enterpriseName}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|