EnterpriseBaseDataTotalMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.enteprise.industry_run.mapper.EnterpriseBaseDataTotalMapper">
  6. <resultMap type="EnterpriseBaseDataTotal" id="EnterpriseBaseDataTotalResult">
  7. <result property="id" column="id" />
  8. <result property="enterpriseName" column="enterprise_name" />
  9. <result property="location" column="location" />
  10. <result property="industryName" column="industry_name" />
  11. <result property="code" column="code" />
  12. <result property="mainBusiness" column="main_business" />
  13. <result property="landArea" column="land_area" />
  14. <result property="totalIndustrialValue" column="total_industrial_value" />
  15. <result property="gdp" column="gdp" />
  16. <result property="taxableIncome" column="taxable_income" />
  17. <result property="paidTax" column="paid_tax" />
  18. <result property="mainBusinessIncome" column="main_business_income" />
  19. <result property="employeeNumber" column="employee_number" />
  20. <result property="profit" column="profit" />
  21. <result property="ownerEquity" column="owner_equity" />
  22. <result property="funding" column="funding" />
  23. <result property="energyConsume" column="energy_consume" />
  24. <result property="powerConsume" column="power_consume" />
  25. <result property="year" column="year" />
  26. <result property="season" column="season" />
  27. <result property="month" column="month" />
  28. </resultMap>
  29. <sql id="selectEnterpriseBaseDataTotalVo">
  30. 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
  31. </sql>
  32. <select id="selectEnterpriseBaseDataTotalList" parameterType="EnterpriseBaseDataTotal" resultMap="EnterpriseBaseDataTotalResult">
  33. <include refid="selectEnterpriseBaseDataTotalVo"/>
  34. <where>
  35. <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
  36. <if test="location != null and location != ''"> and location = #{location}</if>
  37. <if test="code != null and code != ''"> and code = #{code}</if>
  38. <if test="totalIndustrialValue != null "> and total_industrial_value = #{totalIndustrialValue}</if>
  39. <if test="taxableIncome != null "> and taxable_income = #{taxableIncome}</if>
  40. <if test="paidTax != null "> and paid_tax = #{paidTax}</if>
  41. <if test="funding != null "> and funding = #{funding}</if>
  42. <if test="energyConsume != null "> and energy_consume = #{energyConsume}</if>
  43. <if test="powerConsume != null "> and power_consume = #{powerConsume}</if>
  44. <if test="year != null and year != ''"> and year = #{year}</if>
  45. <if test="season != null and season != ''"> and season = #{season}</if>
  46. <if test="month != null and month != ''"> and month = #{month}</if>
  47. </where>
  48. </select>
  49. <select id="selectEnterpriseBaseDataTotalByEnterpriseName" parameterType="String" resultMap="EnterpriseBaseDataTotalResult">
  50. <include refid="selectEnterpriseBaseDataTotalVo"/>
  51. where enterprise_name = #{enterpriseName}
  52. </select>
  53. <insert id="insertEnterpriseBaseDataTotal" parameterType="EnterpriseBaseDataTotal">
  54. insert into enterprise_base_data_total
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="id != null">id,</if>
  57. <if test="enterpriseName != null">enterprise_name,</if>
  58. <if test="location != null">location,</if>
  59. <if test="industryName != null and industryName != ''">industry_name,</if>
  60. <if test="code != null">code,</if>
  61. <if test="mainBusiness != null">main_business,</if>
  62. <if test="landArea != null">land_area,</if>
  63. <if test="totalIndustrialValue != null">total_industrial_value,</if>
  64. <if test="gdp != null">gdp,</if>
  65. <if test="taxableIncome != null">taxable_income,</if>
  66. <if test="paidTax != null">paid_tax,</if>
  67. <if test="mainBusinessIncome != null">main_business_income,</if>
  68. <if test="employeeNumber != null">employee_number,</if>
  69. <if test="profit != null">profit,</if>
  70. <if test="ownerEquity != null">owner_equity,</if>
  71. <if test="funding != null">funding,</if>
  72. <if test="energyConsume != null">energy_consume,</if>
  73. <if test="powerConsume != null">power_consume,</if>
  74. <if test="year != null">year,</if>
  75. <if test="season != null and season != ''">season,</if>
  76. <if test="month != null">month,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="id != null">#{id},</if>
  80. <if test="enterpriseName != null">#{enterpriseName},</if>
  81. <if test="location != null">#{location},</if>
  82. <if test="industryName != null and industryName != ''">#{industryName},</if>
  83. <if test="code != null">#{code},</if>
  84. <if test="mainBusiness != null">#{mainBusiness},</if>
  85. <if test="landArea != null">#{landArea},</if>
  86. <if test="totalIndustrialValue != null">#{totalIndustrialValue},</if>
  87. <if test="gdp != null">#{gdp},</if>
  88. <if test="taxableIncome != null">#{taxableIncome},</if>
  89. <if test="paidTax != null">#{paidTax},</if>
  90. <if test="mainBusinessIncome != null">#{mainBusinessIncome},</if>
  91. <if test="employeeNumber != null">#{employeeNumber},</if>
  92. <if test="profit != null">#{profit},</if>
  93. <if test="ownerEquity != null">#{ownerEquity},</if>
  94. <if test="funding != null">#{funding},</if>
  95. <if test="energyConsume != null">#{energyConsume},</if>
  96. <if test="powerConsume != null">#{powerConsume},</if>
  97. <if test="year != null">#{year},</if>
  98. <if test="season != null and season != ''">#{season},</if>
  99. <if test="month != null">#{month},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateEnterpriseBaseDataTotal" parameterType="EnterpriseBaseDataTotal">
  103. update enterprise_base_data_total
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="id != null">id = #{id},</if>
  106. <if test="location != null">location = #{location},</if>
  107. <if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
  108. <if test="code != null">code = #{code},</if>
  109. <if test="mainBusiness != null">main_business = #{mainBusiness},</if>
  110. <if test="landArea != null">land_area = #{landArea},</if>
  111. <if test="totalIndustrialValue != null">total_industrial_value = #{totalIndustrialValue},</if>
  112. <if test="gdp != null">gdp = #{gdp},</if>
  113. <if test="taxableIncome != null">taxable_income = #{taxableIncome},</if>
  114. <if test="paidTax != null">paid_tax = #{paidTax},</if>
  115. <if test="mainBusinessIncome != null">main_business_income = #{mainBusinessIncome},</if>
  116. <if test="employeeNumber != null">employee_number = #{employeeNumber},</if>
  117. <if test="profit != null">profit = #{profit},</if>
  118. <if test="ownerEquity != null">owner_equity = #{ownerEquity},</if>
  119. <if test="funding != null">funding = #{funding},</if>
  120. <if test="energyConsume != null">energy_consume = #{energyConsume},</if>
  121. <if test="powerConsume != null">power_consume = #{powerConsume},</if>
  122. <if test="year != null">year = #{year},</if>
  123. <if test="season != null and season != ''">season = #{season},</if>
  124. <if test="month != null">month = #{month},</if>
  125. </trim>
  126. where enterprise_name = #{enterpriseName}
  127. </update>
  128. <delete id="deleteEnterpriseBaseDataTotalByEnterpriseName" parameterType="String">
  129. delete from enterprise_base_data_total where enterprise_name = #{enterpriseName}
  130. </delete>
  131. <delete id="deleteEnterpriseBaseDataTotalByEnterpriseNames" parameterType="String">
  132. delete from enterprise_base_data_total where enterprise_name in
  133. <foreach item="enterpriseName" collection="array" open="(" separator="," close=")">
  134. #{enterpriseName}
  135. </foreach>
  136. </delete>
  137. </mapper>