OrgActivityCostMapper.xml 13 KB

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