DeptResponsibilityTargetDao.xml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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.ims.eval.dao.DeptResponsibilityTargetDao">
  4. <sql id="deptResponsibilityTargetColumns">
  5. a.id AS "id",
  6. a.responsibility_id AS "responsibilityId",
  7. a.indicator_id AS "indicatorId",
  8. a.quantization_target AS "quantizationTarget",
  9. a.quantization_target_actual AS "quantizationTargetActual",
  10. a.evaluation_target AS "evaluationTarget",
  11. a.evaluation_target_actual AS "evaluationTargetActual",
  12. a.month_threshold AS "monthThreshold",
  13. a.season_threshold AS "seasonThreshold",
  14. a.year_threshold AS "yearThreshold",
  15. a.direction AS "direction",
  16. a.order_num AS "orderNum",
  17. a.remark AS "remark",
  18. a.target_1 AS "target1",
  19. a.actual_1 AS "actual1",
  20. a.target_2 AS "target2",
  21. a.actual_2 AS "actual2",
  22. a.target_3 AS "target3",
  23. a.actual_3 AS "actual3",
  24. a.target_4 AS "target4",
  25. a.actual_4 AS "actual4",
  26. a.target_5 AS "target5",
  27. a.actual_5 AS "actual5",
  28. a.target_6 AS "target6",
  29. a.actual_6 AS "actual6",
  30. a.target_7 AS "target7",
  31. a.actual_7 AS "actual7",
  32. a.target_8 AS "target8",
  33. a.actual_8 AS "actual8",
  34. a.target_9 AS "target9",
  35. a.actual_9 AS "actual9",
  36. a.target_10 AS "target10",
  37. a.actual_10 AS "actual10",
  38. a.target_11 AS "target11",
  39. a.actual_11 AS "actual11",
  40. a.target_12 AS "target12",
  41. a.actual_12 AS "actual12"
  42. </sql>
  43. <sql id="whereStr">
  44. 1=1
  45. <!-- 快速定位 -->
  46. <if test="sqlMap.key != null and sqlMap.key != ''">
  47. AND (
  48. )
  49. </if>
  50. <!-- 高级查询dataFilter -->
  51. <if test="sqlMap.df != null and sqlMap.df != ''">
  52. AND ( ${sqlMap.df} )
  53. </if>
  54. <!-- 默认查询baseFilter -->
  55. <if test="sqlMap.bf != null and sqlMap.bf != ''">
  56. AND ( ${sqlMap.bf} )
  57. </if>
  58. <!-- 基本Query查询 -->
  59. <if test="sqlMap.baseQuery != null and sqlMap.baseQuery != ''">
  60. AND ( ${sqlMap.baseQuery} )
  61. </if>
  62. <!-- 特定Query查询 -->
  63. <if test="sqlMap.specQuery != null and sqlMap.specQuery != ''">
  64. AND ( ${sqlMap.specQuery} )
  65. </if>
  66. <if test="sqlMap.dsf != null and sqlMap.dsf != ''">
  67. AND (${sqlMap.dsf})
  68. </if>
  69. </sql>
  70. <select id="get" resultType="DeptResponsibilityTarget">
  71. SELECT
  72. <include refid="deptResponsibilityTargetColumns"/>
  73. FROM public.{table.name} a
  74. WHERE a.id = #{id}
  75. </select>
  76. <select id="findList" resultType="DeptResponsibilityTarget">
  77. SELECT
  78. <include refid="deptResponsibilityTargetColumns"/>
  79. FROM public.dept_responsibility_target a
  80. <where>
  81. <include refid="whereStr"/>
  82. </where>
  83. <choose>
  84. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  85. ORDER BY ${page.orderBy}
  86. </when>
  87. <otherwise>
  88. </otherwise>
  89. </choose>
  90. </select>
  91. <select id="findAllList" resultType="DeptResponsibilityTarget">
  92. SELECT
  93. <include refid="deptResponsibilityTargetColumns"/>
  94. FROM public.dept_responsibility_target a
  95. <where>
  96. <include refid="whereStr"/>
  97. </where>
  98. <choose>
  99. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  100. ORDER BY ${page.orderBy}
  101. </when>
  102. <otherwise>
  103. </otherwise>
  104. </choose>
  105. </select>
  106. <sql id="insertColumns">
  107. id,
  108. responsibility_id,
  109. indicator_id,
  110. quantization_target,
  111. quantization_target_actual,
  112. evaluation_target,
  113. evaluation_target_actual,
  114. month_threshold,
  115. season_threshold,
  116. year_threshold,
  117. direction,
  118. order_num,
  119. remark,
  120. target_1,
  121. actual_1,
  122. target_2,
  123. actual_2,
  124. target_3,
  125. actual_3,
  126. target_4,
  127. actual_4,
  128. target_5,
  129. actual_5,
  130. target_6,
  131. actual_6,
  132. target_7,
  133. actual_7,
  134. target_8,
  135. actual_8,
  136. target_9,
  137. actual_9,
  138. target_10,
  139. actual_10,
  140. target_11,
  141. actual_11,
  142. target_12,
  143. actual_12
  144. </sql>
  145. <insert id="insert">
  146. <selectKey keyProperty="id" resultType="String" order="BEFORE">
  147. <choose>
  148. <when test="id == null or id == ''">
  149. select get_next_id('dept_responsibility_target','') from dual
  150. </when>
  151. <otherwise>
  152. select #{id} from dual
  153. </otherwise>
  154. </choose>
  155. </selectKey>
  156. INSERT INTO dept_responsibility_target(
  157. <include refid="insertColumns"/>
  158. ) VALUES (
  159. #{id
  160. , jdbcType=VARCHAR
  161. },
  162. #{responsibilityId
  163. , jdbcType=VARCHAR
  164. },
  165. #{indicatorId
  166. , jdbcType=VARCHAR
  167. },
  168. #{quantizationTarget
  169. },
  170. #{quantizationTargetActual
  171. },
  172. #{evaluationTarget
  173. , jdbcType=VARCHAR
  174. },
  175. #{evaluationTargetActual
  176. },
  177. #{monthThreshold
  178. },
  179. #{seasonThreshold
  180. },
  181. #{yearThreshold
  182. },
  183. #{direction
  184. },
  185. #{orderNum
  186. },
  187. #{remark
  188. , jdbcType=VARCHAR
  189. },
  190. #{target1
  191. },
  192. #{actual1
  193. },
  194. #{target2
  195. },
  196. #{actual2
  197. },
  198. #{target3
  199. },
  200. #{actual3
  201. },
  202. #{target4
  203. },
  204. #{actual4
  205. },
  206. #{target5
  207. },
  208. #{actual5
  209. },
  210. #{target6
  211. },
  212. #{actual6
  213. },
  214. #{target7
  215. },
  216. #{actual7
  217. },
  218. #{target8
  219. },
  220. #{actual8
  221. },
  222. #{target9
  223. },
  224. #{actual9
  225. },
  226. #{target10
  227. },
  228. #{actual10
  229. },
  230. #{target11
  231. },
  232. #{actual11
  233. },
  234. #{target12
  235. },
  236. #{actual12
  237. }
  238. )
  239. </insert>
  240. <insert id="insertList">
  241. INSERT INTO dept_responsibility_target(
  242. <include refid="insertColumns"/>
  243. ) select FFF.* from (
  244. <foreach collection="list" item="item" index="index" separator="UNION ALL" >
  245. select
  246. #{item.id, jdbcType=VARCHAR} as "id",
  247. #{item.responsibilityId, jdbcType=VARCHAR} as "responsibilityId",
  248. #{item.indicatorId, jdbcType=VARCHAR} as "indicatorId",
  249. #{item.quantizationTarget} as "quantizationTarget",
  250. #{item.quantizationTargetActual} as "quantizationTargetActual",
  251. #{item.evaluationTarget, jdbcType=VARCHAR} as "evaluationTarget",
  252. #{item.evaluationTargetActual} as "evaluationTargetActual",
  253. #{item.monthThreshold} as "monthThreshold",
  254. #{item.seasonThreshold} as "seasonThreshold",
  255. #{item.yearThreshold} as "yearThreshold",
  256. #{item.direction} as "direction",
  257. #{item.orderNum} as "orderNum",
  258. #{item.remark, jdbcType=VARCHAR} as "remark",
  259. #{item.target1} as "target1",
  260. #{item.actual1} as "actual1",
  261. #{item.target2} as "target2",
  262. #{item.actual2} as "actual2",
  263. #{item.target3} as "target3",
  264. #{item.actual3} as "actual3",
  265. #{item.target4} as "target4",
  266. #{item.actual4} as "actual4",
  267. #{item.target5} as "target5",
  268. #{item.actual5} as "actual5",
  269. #{item.target6} as "target6",
  270. #{item.actual6} as "actual6",
  271. #{item.target7} as "target7",
  272. #{item.actual7} as "actual7",
  273. #{item.target8} as "target8",
  274. #{item.actual8} as "actual8",
  275. #{item.target9} as "target9",
  276. #{item.actual9} as "actual9",
  277. #{item.target10} as "target10",
  278. #{item.actual10} as "actual10",
  279. #{item.target11} as "target11",
  280. #{item.actual11} as "actual11",
  281. #{item.target12} as "target12",
  282. #{item.actual12} as "actual12"
  283. from dual
  284. </foreach>
  285. ) FFF
  286. </insert>
  287. <update id="update">
  288. UPDATE dept_responsibility_target SET
  289. id = #{id},
  290. responsibility_id = #{responsibilityId},
  291. indicator_id = #{indicatorId},
  292. quantization_target = #{quantizationTarget},
  293. quantization_target_actual = #{quantizationTargetActual},
  294. evaluation_target = #{evaluationTarget},
  295. evaluation_target_actual = #{evaluationTargetActual},
  296. month_threshold = #{monthThreshold},
  297. season_threshold = #{seasonThreshold},
  298. year_threshold = #{yearThreshold},
  299. direction = #{direction},
  300. order_num = #{orderNum},
  301. remark = #{remark},
  302. target_1 = #{target1},
  303. actual_1 = #{actual1},
  304. target_2 = #{target2},
  305. actual_2 = #{actual2},
  306. target_3 = #{target3},
  307. actual_3 = #{actual3},
  308. target_4 = #{target4},
  309. actual_4 = #{actual4},
  310. target_5 = #{target5},
  311. actual_5 = #{actual5},
  312. target_6 = #{target6},
  313. actual_6 = #{actual6},
  314. target_7 = #{target7},
  315. actual_7 = #{actual7},
  316. target_8 = #{target8},
  317. actual_8 = #{actual8},
  318. target_9 = #{target9},
  319. actual_9 = #{actual9},
  320. target_10 = #{target10},
  321. actual_10 = #{actual10},
  322. target_11 = #{target11},
  323. actual_11 = #{actual11},
  324. target_12 = #{target12},
  325. actual_12 = #{actual12}
  326. WHERE id = #{id, jdbcType=VARCHAR}
  327. </update>
  328. <update id="delete">
  329. DELETE FROM public.dept_responsibility_target
  330. WHERE
  331. <choose>
  332. <when test="id != null and id != ''">
  333. id = #{id, jdbcType=VARCHAR}
  334. </when>
  335. <otherwise>
  336. </otherwise>
  337. </choose>
  338. </update>
  339. </mapper>