OrgActivityMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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.OrgActivityMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgActivity" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="activity_number" property="activityNumber" jdbcType="VARCHAR" />
  8. <result column="activity_name" property="activityName" jdbcType="VARCHAR" />
  9. <result column="start_date" property="startDate" jdbcType="TIMESTAMP" />
  10. <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
  11. <result column="technical_field1" property="technicalField1" jdbcType="VARCHAR" />
  12. <result column="technical_field2" property="technicalField2" jdbcType="VARCHAR" />
  13. <result column="technical_field3" property="technicalField3" jdbcType="VARCHAR" />
  14. <result column="technical_source" property="technicalSource" jdbcType="INTEGER" />
  15. <result column="intellectual_property_number" property="intellectualPropertyNumber" jdbcType="VARCHAR" />
  16. <result column="budget" property="budget" jdbcType="INTEGER" />
  17. <result column="first_year_expenditure" property="firstYearExpenditure" jdbcType="INTEGER" />
  18. <result column="second_year_expenditure" property="secondYearExpenditure" jdbcType="INTEGER" />
  19. <result column="third_year_expenditure" property="thirdYearExpenditure" jdbcType="INTEGER" />
  20. <result column="implement" property="implement" jdbcType="VARCHAR" />
  21. <result column="technology_innovation" property="technologyInnovation" jdbcType="VARCHAR" />
  22. <result column="achievement" property="achievement" jdbcType="VARCHAR" />
  23. <result column="internal_labor_cost" property="internalLaborCost" jdbcType="INTEGER" />
  24. <result column="internal_direct_cost" property="internalDirectCost" jdbcType="INTEGER" />
  25. <result column="internal_depreciation_cost" property="internalDepreciationCost" jdbcType="INTEGER" />
  26. <result column="internal_amortization_cost" property="internalAmortizationCost" jdbcType="INTEGER" />
  27. <result column="internal_design_cost" property="internalDesignCost" jdbcType="INTEGER" />
  28. <result column="internal_equipment_cost" property="internalEquipmentCost" jdbcType="INTEGER" />
  29. <result column="internal_other_cost" property="internalOtherCost" jdbcType="INTEGER" />
  30. <result column="external_total_cost" property="externalTotalCost" jdbcType="INTEGER" />
  31. <result column="external_abroad_cost" property="externalAbroadCost" jdbcType="INTEGER" />
  32. <result column="enterprise_filler" property="enterpriseFiller" jdbcType="VARCHAR" />
  33. <result column="sign_date" property="signDate" jdbcType="TIMESTAMP" />
  34. <result column="sort_number" property="sortNumber" jdbcType="VARCHAR" />
  35. </resultMap>
  36. <sql id="Base_Column_List" >
  37. id, uid, activity_number, activity_name, start_date, end_date, technical_field1,
  38. technical_field2, technical_field3, technical_source, intellectual_property_number,
  39. budget, first_year_expenditure, second_year_expenditure, third_year_expenditure,
  40. implement, technology_innovation, achievement, internal_labor_cost, internal_direct_cost,
  41. internal_depreciation_cost, internal_amortization_cost, internal_design_cost, internal_equipment_cost,
  42. internal_other_cost, external_total_cost, external_abroad_cost, enterprise_filler,
  43. sign_date, sort_number
  44. </sql>
  45. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  46. select
  47. <include refid="Base_Column_List" />
  48. from org_activity
  49. where id = #{id,jdbcType=VARCHAR}
  50. </select>
  51. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  52. delete from org_activity
  53. where id = #{id,jdbcType=VARCHAR}
  54. </delete>
  55. <insert id="insert" parameterType="com.goafanti.common.model.OrgActivity" >
  56. insert into org_activity (id, uid, activity_number,
  57. activity_name, start_date, end_date,
  58. technical_field1, technical_field2, technical_field3,
  59. technical_source, intellectual_property_number,
  60. budget, first_year_expenditure, second_year_expenditure,
  61. third_year_expenditure, implement, technology_innovation,
  62. achievement, internal_labor_cost, internal_direct_cost,
  63. internal_depreciation_cost, internal_amortization_cost,
  64. internal_design_cost, internal_equipment_cost,
  65. internal_other_cost, external_total_cost, external_abroad_cost,
  66. enterprise_filler, sign_date, sort_number
  67. )
  68. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{activityNumber,jdbcType=VARCHAR},
  69. #{activityName,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP},
  70. #{technicalField1,jdbcType=VARCHAR}, #{technicalField2,jdbcType=VARCHAR}, #{technicalField3,jdbcType=VARCHAR},
  71. #{technicalSource,jdbcType=INTEGER}, #{intellectualPropertyNumber,jdbcType=VARCHAR},
  72. #{budget,jdbcType=INTEGER}, #{firstYearExpenditure,jdbcType=INTEGER}, #{secondYearExpenditure,jdbcType=INTEGER},
  73. #{thirdYearExpenditure,jdbcType=INTEGER}, #{implement,jdbcType=VARCHAR}, #{technologyInnovation,jdbcType=VARCHAR},
  74. #{achievement,jdbcType=VARCHAR}, #{internalLaborCost,jdbcType=INTEGER}, #{internalDirectCost,jdbcType=INTEGER},
  75. #{internalDepreciationCost,jdbcType=INTEGER}, #{internalAmortizationCost,jdbcType=INTEGER},
  76. #{internalDesignCost,jdbcType=INTEGER}, #{internalEquipmentCost,jdbcType=INTEGER},
  77. #{internalOtherCost,jdbcType=INTEGER}, #{externalTotalCost,jdbcType=INTEGER}, #{externalAbroadCost,jdbcType=INTEGER},
  78. #{enterpriseFiller,jdbcType=VARCHAR}, #{signDate,jdbcType=TIMESTAMP}, #{sortNumber,jdbcType=VARCHAR}
  79. )
  80. </insert>
  81. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgActivity" >
  82. insert into org_activity
  83. <trim prefix="(" suffix=")" suffixOverrides="," >
  84. <if test="id != null" >
  85. id,
  86. </if>
  87. <if test="uid != null" >
  88. uid,
  89. </if>
  90. <if test="activityNumber != null" >
  91. activity_number,
  92. </if>
  93. <if test="activityName != null" >
  94. activity_name,
  95. </if>
  96. <if test="startDate != null" >
  97. start_date,
  98. </if>
  99. <if test="endDate != null" >
  100. end_date,
  101. </if>
  102. <if test="technicalField1 != null" >
  103. technical_field1,
  104. </if>
  105. <if test="technicalField2 != null" >
  106. technical_field2,
  107. </if>
  108. <if test="technicalField3 != null" >
  109. technical_field3,
  110. </if>
  111. <if test="technicalSource != null" >
  112. technical_source,
  113. </if>
  114. <if test="intellectualPropertyNumber != null" >
  115. intellectual_property_number,
  116. </if>
  117. <if test="budget != null" >
  118. budget,
  119. </if>
  120. <if test="firstYearExpenditure != null" >
  121. first_year_expenditure,
  122. </if>
  123. <if test="secondYearExpenditure != null" >
  124. second_year_expenditure,
  125. </if>
  126. <if test="thirdYearExpenditure != null" >
  127. third_year_expenditure,
  128. </if>
  129. <if test="implement != null" >
  130. implement,
  131. </if>
  132. <if test="technologyInnovation != null" >
  133. technology_innovation,
  134. </if>
  135. <if test="achievement != null" >
  136. achievement,
  137. </if>
  138. <if test="internalLaborCost != null" >
  139. internal_labor_cost,
  140. </if>
  141. <if test="internalDirectCost != null" >
  142. internal_direct_cost,
  143. </if>
  144. <if test="internalDepreciationCost != null" >
  145. internal_depreciation_cost,
  146. </if>
  147. <if test="internalAmortizationCost != null" >
  148. internal_amortization_cost,
  149. </if>
  150. <if test="internalDesignCost != null" >
  151. internal_design_cost,
  152. </if>
  153. <if test="internalEquipmentCost != null" >
  154. internal_equipment_cost,
  155. </if>
  156. <if test="internalOtherCost != null" >
  157. internal_other_cost,
  158. </if>
  159. <if test="externalTotalCost != null" >
  160. external_total_cost,
  161. </if>
  162. <if test="externalAbroadCost != null" >
  163. external_abroad_cost,
  164. </if>
  165. <if test="enterpriseFiller != null" >
  166. enterprise_filler,
  167. </if>
  168. <if test="signDate != null" >
  169. sign_date,
  170. </if>
  171. <if test="sortNumber != null" >
  172. sort_number,
  173. </if>
  174. </trim>
  175. <trim prefix="values (" suffix=")" suffixOverrides="," >
  176. <if test="id != null" >
  177. #{id,jdbcType=VARCHAR},
  178. </if>
  179. <if test="uid != null" >
  180. #{uid,jdbcType=VARCHAR},
  181. </if>
  182. <if test="activityNumber != null" >
  183. #{activityNumber,jdbcType=VARCHAR},
  184. </if>
  185. <if test="activityName != null" >
  186. #{activityName,jdbcType=VARCHAR},
  187. </if>
  188. <if test="startDate != null" >
  189. #{startDate,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="endDate != null" >
  192. #{endDate,jdbcType=TIMESTAMP},
  193. </if>
  194. <if test="technicalField1 != null" >
  195. #{technicalField1,jdbcType=VARCHAR},
  196. </if>
  197. <if test="technicalField2 != null" >
  198. #{technicalField2,jdbcType=VARCHAR},
  199. </if>
  200. <if test="technicalField3 != null" >
  201. #{technicalField3,jdbcType=VARCHAR},
  202. </if>
  203. <if test="technicalSource != null" >
  204. #{technicalSource,jdbcType=INTEGER},
  205. </if>
  206. <if test="intellectualPropertyNumber != null" >
  207. #{intellectualPropertyNumber,jdbcType=VARCHAR},
  208. </if>
  209. <if test="budget != null" >
  210. #{budget,jdbcType=INTEGER},
  211. </if>
  212. <if test="firstYearExpenditure != null" >
  213. #{firstYearExpenditure,jdbcType=INTEGER},
  214. </if>
  215. <if test="secondYearExpenditure != null" >
  216. #{secondYearExpenditure,jdbcType=INTEGER},
  217. </if>
  218. <if test="thirdYearExpenditure != null" >
  219. #{thirdYearExpenditure,jdbcType=INTEGER},
  220. </if>
  221. <if test="implement != null" >
  222. #{implement,jdbcType=VARCHAR},
  223. </if>
  224. <if test="technologyInnovation != null" >
  225. #{technologyInnovation,jdbcType=VARCHAR},
  226. </if>
  227. <if test="achievement != null" >
  228. #{achievement,jdbcType=VARCHAR},
  229. </if>
  230. <if test="internalLaborCost != null" >
  231. #{internalLaborCost,jdbcType=INTEGER},
  232. </if>
  233. <if test="internalDirectCost != null" >
  234. #{internalDirectCost,jdbcType=INTEGER},
  235. </if>
  236. <if test="internalDepreciationCost != null" >
  237. #{internalDepreciationCost,jdbcType=INTEGER},
  238. </if>
  239. <if test="internalAmortizationCost != null" >
  240. #{internalAmortizationCost,jdbcType=INTEGER},
  241. </if>
  242. <if test="internalDesignCost != null" >
  243. #{internalDesignCost,jdbcType=INTEGER},
  244. </if>
  245. <if test="internalEquipmentCost != null" >
  246. #{internalEquipmentCost,jdbcType=INTEGER},
  247. </if>
  248. <if test="internalOtherCost != null" >
  249. #{internalOtherCost,jdbcType=INTEGER},
  250. </if>
  251. <if test="externalTotalCost != null" >
  252. #{externalTotalCost,jdbcType=INTEGER},
  253. </if>
  254. <if test="externalAbroadCost != null" >
  255. #{externalAbroadCost,jdbcType=INTEGER},
  256. </if>
  257. <if test="enterpriseFiller != null" >
  258. #{enterpriseFiller,jdbcType=VARCHAR},
  259. </if>
  260. <if test="signDate != null" >
  261. #{signDate,jdbcType=TIMESTAMP},
  262. </if>
  263. <if test="sortNumber != null" >
  264. #{sortNumber,jdbcType=VARCHAR},
  265. </if>
  266. </trim>
  267. </insert>
  268. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgActivity" >
  269. update org_activity
  270. <set >
  271. <if test="uid != null" >
  272. uid = #{uid,jdbcType=VARCHAR},
  273. </if>
  274. <if test="activityNumber != null" >
  275. activity_number = #{activityNumber,jdbcType=VARCHAR},
  276. </if>
  277. <if test="activityName != null" >
  278. activity_name = #{activityName,jdbcType=VARCHAR},
  279. </if>
  280. <if test="startDate != null" >
  281. start_date = #{startDate,jdbcType=TIMESTAMP},
  282. </if>
  283. <if test="endDate != null" >
  284. end_date = #{endDate,jdbcType=TIMESTAMP},
  285. </if>
  286. <if test="technicalField1 != null" >
  287. technical_field1 = #{technicalField1,jdbcType=VARCHAR},
  288. </if>
  289. <if test="technicalField2 != null" >
  290. technical_field2 = #{technicalField2,jdbcType=VARCHAR},
  291. </if>
  292. <if test="technicalField3 != null" >
  293. technical_field3 = #{technicalField3,jdbcType=VARCHAR},
  294. </if>
  295. <if test="technicalSource != null" >
  296. technical_source = #{technicalSource,jdbcType=INTEGER},
  297. </if>
  298. <if test="intellectualPropertyNumber != null" >
  299. intellectual_property_number = #{intellectualPropertyNumber,jdbcType=VARCHAR},
  300. </if>
  301. <if test="budget != null" >
  302. budget = #{budget,jdbcType=INTEGER},
  303. </if>
  304. <if test="firstYearExpenditure != null" >
  305. first_year_expenditure = #{firstYearExpenditure,jdbcType=INTEGER},
  306. </if>
  307. <if test="secondYearExpenditure != null" >
  308. second_year_expenditure = #{secondYearExpenditure,jdbcType=INTEGER},
  309. </if>
  310. <if test="thirdYearExpenditure != null" >
  311. third_year_expenditure = #{thirdYearExpenditure,jdbcType=INTEGER},
  312. </if>
  313. <if test="implement != null" >
  314. implement = #{implement,jdbcType=VARCHAR},
  315. </if>
  316. <if test="technologyInnovation != null" >
  317. technology_innovation = #{technologyInnovation,jdbcType=VARCHAR},
  318. </if>
  319. <if test="achievement != null" >
  320. achievement = #{achievement,jdbcType=VARCHAR},
  321. </if>
  322. <if test="internalLaborCost != null" >
  323. internal_labor_cost = #{internalLaborCost,jdbcType=INTEGER},
  324. </if>
  325. <if test="internalDirectCost != null" >
  326. internal_direct_cost = #{internalDirectCost,jdbcType=INTEGER},
  327. </if>
  328. <if test="internalDepreciationCost != null" >
  329. internal_depreciation_cost = #{internalDepreciationCost,jdbcType=INTEGER},
  330. </if>
  331. <if test="internalAmortizationCost != null" >
  332. internal_amortization_cost = #{internalAmortizationCost,jdbcType=INTEGER},
  333. </if>
  334. <if test="internalDesignCost != null" >
  335. internal_design_cost = #{internalDesignCost,jdbcType=INTEGER},
  336. </if>
  337. <if test="internalEquipmentCost != null" >
  338. internal_equipment_cost = #{internalEquipmentCost,jdbcType=INTEGER},
  339. </if>
  340. <if test="internalOtherCost != null" >
  341. internal_other_cost = #{internalOtherCost,jdbcType=INTEGER},
  342. </if>
  343. <if test="externalTotalCost != null" >
  344. external_total_cost = #{externalTotalCost,jdbcType=INTEGER},
  345. </if>
  346. <if test="externalAbroadCost != null" >
  347. external_abroad_cost = #{externalAbroadCost,jdbcType=INTEGER},
  348. </if>
  349. <if test="enterpriseFiller != null" >
  350. enterprise_filler = #{enterpriseFiller,jdbcType=VARCHAR},
  351. </if>
  352. <if test="signDate != null" >
  353. sign_date = #{signDate,jdbcType=TIMESTAMP},
  354. </if>
  355. <if test="sortNumber != null" >
  356. sort_number = #{sortNumber,jdbcType=VARCHAR},
  357. </if>
  358. </set>
  359. where id = #{id,jdbcType=VARCHAR}
  360. </update>
  361. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgActivity" >
  362. update org_activity
  363. set uid = #{uid,jdbcType=VARCHAR},
  364. activity_number = #{activityNumber,jdbcType=VARCHAR},
  365. activity_name = #{activityName,jdbcType=VARCHAR},
  366. start_date = #{startDate,jdbcType=TIMESTAMP},
  367. end_date = #{endDate,jdbcType=TIMESTAMP},
  368. technical_field1 = #{technicalField1,jdbcType=VARCHAR},
  369. technical_field2 = #{technicalField2,jdbcType=VARCHAR},
  370. technical_field3 = #{technicalField3,jdbcType=VARCHAR},
  371. technical_source = #{technicalSource,jdbcType=INTEGER},
  372. intellectual_property_number = #{intellectualPropertyNumber,jdbcType=VARCHAR},
  373. budget = #{budget,jdbcType=INTEGER},
  374. first_year_expenditure = #{firstYearExpenditure,jdbcType=INTEGER},
  375. second_year_expenditure = #{secondYearExpenditure,jdbcType=INTEGER},
  376. third_year_expenditure = #{thirdYearExpenditure,jdbcType=INTEGER},
  377. implement = #{implement,jdbcType=VARCHAR},
  378. technology_innovation = #{technologyInnovation,jdbcType=VARCHAR},
  379. achievement = #{achievement,jdbcType=VARCHAR},
  380. internal_labor_cost = #{internalLaborCost,jdbcType=INTEGER},
  381. internal_direct_cost = #{internalDirectCost,jdbcType=INTEGER},
  382. internal_depreciation_cost = #{internalDepreciationCost,jdbcType=INTEGER},
  383. internal_amortization_cost = #{internalAmortizationCost,jdbcType=INTEGER},
  384. internal_design_cost = #{internalDesignCost,jdbcType=INTEGER},
  385. internal_equipment_cost = #{internalEquipmentCost,jdbcType=INTEGER},
  386. internal_other_cost = #{internalOtherCost,jdbcType=INTEGER},
  387. external_total_cost = #{externalTotalCost,jdbcType=INTEGER},
  388. external_abroad_cost = #{externalAbroadCost,jdbcType=INTEGER},
  389. enterprise_filler = #{enterpriseFiller,jdbcType=VARCHAR},
  390. sign_date = #{signDate,jdbcType=TIMESTAMP},
  391. sort_number = #{sortNumber,jdbcType=VARCHAR}
  392. where id = #{id,jdbcType=VARCHAR}
  393. </update>
  394. <select id="findOrgActivityListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  395. select
  396. <include refid="Base_Column_List" />
  397. from org_activity
  398. where 1=1
  399. <if test="uid != null">
  400. and uid = #{uid,jdbcType=VARCHAR}
  401. </if>
  402. <if test="activityNumber != null">
  403. and activity_number = #{activityNumber,jdbcType=VARCHAR}
  404. </if>
  405. <if test="activityName != null">
  406. and activity_name= #{activityName,jdbcType=VARCHAR}
  407. </if>
  408. <if test="startDate != null">
  409. and start_date <![CDATA[ > ]]> #{startDate,jdbcType=TIMESTAMP}
  410. </if>
  411. <if test="endDate != null">
  412. and end_date <![CDATA[ < ]]> #{endDate,jdbcType=TIMESTAMP}
  413. </if>
  414. <if test="page_sql != null">
  415. ${page_sql}
  416. </if>
  417. </select>
  418. <select id="findOrgActivityCount" resultType="java.lang.Integer" parameterType="String">
  419. select count(1) from (
  420. select
  421. <include refid="Base_Column_List" />
  422. from org_activity
  423. where 1=1
  424. <if test="uid != null">
  425. and uid = #{uid,jdbcType=VARCHAR}
  426. </if>
  427. <if test="activityNumber != null">
  428. and activity_number = #{activityNumber,jdbcType=VARCHAR}
  429. </if>
  430. <if test="activityName != null">
  431. and activity_name= #{activityName,jdbcType=VARCHAR}
  432. </if>
  433. <if test="startDate != null">
  434. and start_date <![CDATA[ > ]]> #{startDate,jdbcType=TIMESTAMP}
  435. </if>
  436. <if test="endDate != null">
  437. and end_date <![CDATA[ < ]]> #{endDate,jdbcType=TIMESTAMP}
  438. </if>
  439. <if test="page_sql != null">
  440. ${page_sql}
  441. </if>
  442. ) as total
  443. </select>
  444. </mapper>