OrgActivityCostMapper.xml 14 KB

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