OrgActivityMapper.xml 15 KB

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