OrgFinanceMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.goafanti.common.dao.OrgFinanceMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgFinance" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="main_business_income" property="mainBusinessIncome" jdbcType="DECIMAL" />
  8. <result column="management_cost" property="managementCost" jdbcType="DECIMAL" />
  9. <result column="operating_profit" property="operatingProfit" jdbcType="DECIMAL" />
  10. <result column="various_tax" property="variousTax" jdbcType="DECIMAL" />
  11. <result column="current_asset" property="currentAsset" jdbcType="DECIMAL" />
  12. <result column="net_fixed_asset" property="netFixedAsset" jdbcType="DECIMAL" />
  13. <result column="total_asset" property="totalAsset" jdbcType="DECIMAL" />
  14. <result column="net_asset" property="netAsset" jdbcType="DECIMAL" />
  15. <result column="gross_profit" property="grossProfit" jdbcType="DECIMAL" />
  16. <result column="net_profit" property="netProfit" jdbcType="DECIMAL" />
  17. <result column="sales_revenue" property="salesRevenue" jdbcType="DECIMAL" />
  18. <result column="year" property="year" jdbcType="INTEGER" />
  19. <result column="finance_url" property="financeUrl" jdbcType="VARCHAR" />
  20. <result column="research_cost" property="researchCost" jdbcType="DECIMAL" />
  21. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. id, uid, main_business_income, management_cost, operating_profit, various_tax, current_asset,
  25. net_fixed_asset, total_asset, net_asset, gross_profit, net_profit, sales_revenue, year,
  26. finance_url, research_cost, deleted_sign
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from org_finance
  32. where id = #{id,jdbcType=VARCHAR}
  33. </select>
  34. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  35. delete from org_finance
  36. where id = #{id,jdbcType=VARCHAR}
  37. </delete>
  38. <insert id="insert" parameterType="com.goafanti.common.model.OrgFinance" >
  39. insert into org_finance (id, uid, main_business_income,
  40. management_cost, operating_profit, various_tax,
  41. current_asset, net_fixed_asset, total_asset,
  42. net_asset, gross_profit, net_profit,
  43. sales_revenue, year, finance_url, research_cost, deleted_sign)
  44. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{mainBusinessIncome,jdbcType=DECIMAL},
  45. #{managementCost,jdbcType=DECIMAL}, #{operatingProfit,jdbcType=DECIMAL}, #{variousTax,jdbcType=DECIMAL},
  46. #{currentAsset,jdbcType=DECIMAL}, #{netFixedAsset,jdbcType=DECIMAL}, #{totalAsset,jdbcType=DECIMAL},
  47. #{netAsset,jdbcType=DECIMAL}, #{grossProfit,jdbcType=DECIMAL}, #{netProfit,jdbcType=DECIMAL},
  48. #{salesRevenue,jdbcType=DECIMAL}, #{year,jdbcType=INTEGER}, #{financeUrl,jdbcType=VARCHAR},
  49. #{researchCost,jdbcType=DECIMAL}, #{deletedSign,jdbcType=INTEGER})
  50. </insert>
  51. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgFinance" >
  52. insert into org_finance
  53. <trim prefix="(" suffix=")" suffixOverrides="," >
  54. <if test="id != null" >
  55. id,
  56. </if>
  57. <if test="uid != null" >
  58. uid,
  59. </if>
  60. <if test="mainBusinessIncome != null" >
  61. main_business_income,
  62. </if>
  63. <if test="managementCost != null" >
  64. management_cost,
  65. </if>
  66. <if test="operatingProfit != null" >
  67. operating_profit,
  68. </if>
  69. <if test="variousTax != null" >
  70. various_tax,
  71. </if>
  72. <if test="currentAsset != null" >
  73. current_asset,
  74. </if>
  75. <if test="netFixedAsset != null" >
  76. net_fixed_asset,
  77. </if>
  78. <if test="totalAsset != null" >
  79. total_asset,
  80. </if>
  81. <if test="netAsset != null" >
  82. net_asset,
  83. </if>
  84. <if test="grossProfit != null" >
  85. gross_profit,
  86. </if>
  87. <if test="netProfit != null" >
  88. net_profit,
  89. </if>
  90. <if test="salesRevenue != null" >
  91. sales_revenue,
  92. </if>
  93. <if test="year != null" >
  94. year,
  95. </if>
  96. <if test="financeUrl != null" >
  97. finance_url,
  98. </if>
  99. <if test="researchCost != null" >
  100. research_cost,
  101. </if>
  102. <if test="deletedSign != null" >
  103. deleted_sign,
  104. </if>
  105. </trim>
  106. <trim prefix="values (" suffix=")" suffixOverrides="," >
  107. <if test="id != null" >
  108. #{id,jdbcType=VARCHAR},
  109. </if>
  110. <if test="uid != null" >
  111. #{uid,jdbcType=VARCHAR},
  112. </if>
  113. <if test="mainBusinessIncome != null" >
  114. #{mainBusinessIncome,jdbcType=DECIMAL},
  115. </if>
  116. <if test="managementCost != null" >
  117. #{managementCost,jdbcType=DECIMAL},
  118. </if>
  119. <if test="operatingProfit != null" >
  120. #{operatingProfit,jdbcType=DECIMAL},
  121. </if>
  122. <if test="variousTax != null" >
  123. #{variousTax,jdbcType=DECIMAL},
  124. </if>
  125. <if test="currentAsset != null" >
  126. #{currentAsset,jdbcType=DECIMAL},
  127. </if>
  128. <if test="netFixedAsset != null" >
  129. #{netFixedAsset,jdbcType=DECIMAL},
  130. </if>
  131. <if test="totalAsset != null" >
  132. #{totalAsset,jdbcType=DECIMAL},
  133. </if>
  134. <if test="netAsset != null" >
  135. #{netAsset,jdbcType=DECIMAL},
  136. </if>
  137. <if test="grossProfit != null" >
  138. #{grossProfit,jdbcType=DECIMAL},
  139. </if>
  140. <if test="netProfit != null" >
  141. #{netProfit,jdbcType=DECIMAL},
  142. </if>
  143. <if test="salesRevenue != null" >
  144. #{salesRevenue,jdbcType=DECIMAL},
  145. </if>
  146. <if test="year != null" >
  147. #{year,jdbcType=INTEGER},
  148. </if>
  149. <if test="financeUrl != null" >
  150. #{financeUrl,jdbcType=VARCHAR},
  151. </if>
  152. <if test="researchCost != null" >
  153. #{researchCost,jdbcType=DECIMAL},
  154. </if>
  155. <if test="deletedSign != null" >
  156. #{deletedSign,jdbcType=INTEGER},
  157. </if>
  158. </trim>
  159. </insert>
  160. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgFinance" >
  161. update org_finance
  162. <set >
  163. <if test="uid != null" >
  164. uid = #{uid,jdbcType=VARCHAR},
  165. </if>
  166. <if test="mainBusinessIncome != null" >
  167. main_business_income = #{mainBusinessIncome,jdbcType=DECIMAL},
  168. </if>
  169. <if test="managementCost != null" >
  170. management_cost = #{managementCost,jdbcType=DECIMAL},
  171. </if>
  172. <if test="operatingProfit != null" >
  173. operating_profit = #{operatingProfit,jdbcType=DECIMAL},
  174. </if>
  175. <if test="variousTax != null" >
  176. various_tax = #{variousTax,jdbcType=DECIMAL},
  177. </if>
  178. <if test="currentAsset != null" >
  179. current_asset = #{currentAsset,jdbcType=DECIMAL},
  180. </if>
  181. <if test="netFixedAsset != null" >
  182. net_fixed_asset = #{netFixedAsset,jdbcType=DECIMAL},
  183. </if>
  184. <if test="totalAsset != null" >
  185. total_asset = #{totalAsset,jdbcType=DECIMAL},
  186. </if>
  187. <if test="netAsset != null" >
  188. net_asset = #{netAsset,jdbcType=DECIMAL},
  189. </if>
  190. <if test="grossProfit != null" >
  191. gross_profit = #{grossProfit,jdbcType=DECIMAL},
  192. </if>
  193. <if test="netProfit != null" >
  194. net_profit = #{netProfit,jdbcType=DECIMAL},
  195. </if>
  196. <if test="salesRevenue != null" >
  197. sales_revenue = #{salesRevenue,jdbcType=DECIMAL},
  198. </if>
  199. <if test="year != null" >
  200. year = #{year,jdbcType=INTEGER},
  201. </if>
  202. <if test="financeUrl != null" >
  203. finance_url = #{financeUrl,jdbcType=VARCHAR},
  204. </if>
  205. <if test="researchCost != null" >
  206. research_cost = #{researchCost,jdbcType=DECIMAL},
  207. </if>
  208. <if test="deletedSign != null" >
  209. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  210. </if>
  211. </set>
  212. where id = #{id,jdbcType=VARCHAR}
  213. </update>
  214. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgFinance" >
  215. update org_finance
  216. set uid = #{uid,jdbcType=VARCHAR},
  217. main_business_income = #{mainBusinessIncome,jdbcType=INTEGER},
  218. management_cost = #{managementCost,jdbcType=DECIMAL},
  219. operating_profit = #{operatingProfit,jdbcType=DECIMAL},
  220. various_tax = #{variousTax,jdbcType=DECIMAL},
  221. current_asset = #{currentAsset,jdbcType=DECIMAL},
  222. net_fixed_asset = #{netFixedAsset,jdbcType=DECIMAL},
  223. total_asset = #{totalAsset,jdbcType=DECIMAL},
  224. net_asset = #{netAsset,jdbcType=DECIMAL},
  225. gross_profit = #{grossProfit,jdbcType=DECIMAL},
  226. net_profit = #{netProfit,jdbcType=DECIMAL},
  227. sales_revenue = #{salesRevenue,jdbcType=DECIMAL},
  228. year = #{year,jdbcType=INTEGER},
  229. finance_url = #{financeUrl,jdbcType=VARCHAR},
  230. research_cost = #{researchCost,jdbcType=DECIMAL},
  231. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  232. where id = #{id,jdbcType=VARCHAR}
  233. </update>
  234. <select id="findOrgFinanceListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  235. select
  236. <include refid="Base_Column_List" />
  237. from org_finance
  238. where deleted_sign = 0
  239. <if test="uid != null">
  240. and uid = #{uid,jdbcType=VARCHAR}
  241. </if>
  242. <if test="year != null">
  243. and year = #{year,jdbcType=INTEGER}
  244. </if>
  245. order by year desc
  246. <if test="page_sql != null">
  247. ${page_sql}
  248. </if>
  249. </select>
  250. <select id="findOrgFinanceCount" resultType="java.lang.Integer" parameterType="String">
  251. select count(1)
  252. from org_finance
  253. where deleted_sign = 0
  254. <if test="uid != null">
  255. and uid = #{uid,jdbcType=VARCHAR}
  256. </if>
  257. <if test="year != null">
  258. and year = #{year,jdbcType=INTEGER}
  259. </if>
  260. </select>
  261. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  262. update org_finance set deleted_sign = 1
  263. where id in
  264. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  265. #{item}
  266. </foreach>
  267. </update>
  268. <select id="selectFinanceByUidAndYear" resultMap="BaseResultMap" >
  269. select
  270. <include refid="Base_Column_List" />
  271. from org_finance
  272. where uid = #{0} and year = #{1} and deleted_sign = 0
  273. </select>
  274. </mapper>