LogResultMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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.steerinfo.dil.mapper.LogResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.LogResult">
  5. <id column="LOG_ID" jdbcType="DECIMAL" property="logId" />
  6. <result column="LOG_CONTENT" jdbcType="VARCHAR" property="logContent" />
  7. <result column="FOREIGN_KEY_ID" jdbcType="DECIMAL" property="foreignKeyId" />
  8. <result column="FOREIGN_KEY_TYPE" jdbcType="VARCHAR" property="foreignKeyType" />
  9. <result column="METHOD_NAME" jdbcType="VARCHAR" property="methodName" />
  10. <result column="METHOD_DESCRIPTION" jdbcType="VARCHAR" property="methodDescription" />
  11. <result column="EXE_COST" jdbcType="DECIMAL" property="exeCost" />
  12. <result column="FILE_PATH" jdbcType="VARCHAR" property="filePath" />
  13. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  14. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  15. <result column="REMARK" jdbcType="VARCHAR" property="remark" />
  16. <result column="DATAGRAM1" jdbcType="VARCHAR" property="datagram1" />
  17. <result column="DATAGRAM2" jdbcType="VARCHAR" property="datagram2" />
  18. <result column="DATAGRAM3" jdbcType="VARCHAR" property="datagram3" />
  19. </resultMap>
  20. <sql id="columns">
  21. LOG_ID, LOG_CONTENT, FOREIGN_KEY_ID, FOREIGN_KEY_TYPE, METHOD_NAME, METHOD_DESCRIPTION,
  22. EXE_COST, FILE_PATH, INSERT_TIME, INSERT_USERNAME, REMARK, DATAGRAM1, DATAGRAM2,
  23. DATAGRAM3
  24. </sql>
  25. <sql id="columns_alias">
  26. t.LOG_ID, t.LOG_CONTENT, t.FOREIGN_KEY_ID, t.FOREIGN_KEY_TYPE, t.METHOD_NAME, t.METHOD_DESCRIPTION,
  27. t.EXE_COST, t.FILE_PATH, t.INSERT_TIME, t.INSERT_USERNAME, t.REMARK, t.DATAGRAM1,
  28. t.DATAGRAM2, t.DATAGRAM3
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns"/> FROM LOG_RESULT
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias"/> FROM LOG_RESULT t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="logId != null">
  39. and LOG_ID = #{logId}
  40. </if>
  41. <if test="logContent != null and logContent != ''">
  42. and LOG_CONTENT = #{logContent}
  43. </if>
  44. <if test="foreignKeyId != null">
  45. and FOREIGN_KEY_ID = #{foreignKeyId}
  46. </if>
  47. <if test="foreignKeyType != null and foreignKeyType != ''">
  48. and FOREIGN_KEY_TYPE = #{foreignKeyType}
  49. </if>
  50. <if test="methodName != null and methodName != ''">
  51. and METHOD_NAME = #{methodName}
  52. </if>
  53. <if test="methodDescription != null and methodDescription != ''">
  54. and METHOD_DESCRIPTION = #{methodDescription}
  55. </if>
  56. <if test="exeCost != null">
  57. and EXE_COST = #{exeCost}
  58. </if>
  59. <if test="filePath != null and filePath != ''">
  60. and FILE_PATH = #{filePath}
  61. </if>
  62. <if test="insertTime != null">
  63. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  64. </if>
  65. <if test="insertUsername != null and insertUsername != ''">
  66. and INSERT_USERNAME = #{insertUsername}
  67. </if>
  68. <if test="remark != null and remark != ''">
  69. and REMARK = #{remark}
  70. </if>
  71. <if test="datagram1 != null and datagram1 != ''">
  72. and DATAGRAM1 = #{datagram1}
  73. </if>
  74. <if test="datagram2 != null and datagram2 != ''">
  75. and DATAGRAM2 = #{datagram2}
  76. </if>
  77. <if test="datagram3 != null and datagram3 != ''">
  78. and DATAGRAM3 = #{datagram3}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="logId != null">
  85. and LOG_ID = #{logId}
  86. </if>
  87. <if test="logContent != null and logContent != ''">
  88. and LOG_CONTENT LIKE '%${logContent}%'
  89. </if>
  90. <if test="foreignKeyId != null">
  91. and FOREIGN_KEY_ID = #{foreignKeyId}
  92. </if>
  93. <if test="foreignKeyType != null and foreignKeyType != ''">
  94. and FOREIGN_KEY_TYPE LIKE '%${foreignKeyType}%'
  95. </if>
  96. <if test="methodName != null and methodName != ''">
  97. and METHOD_NAME LIKE '%${methodName}%'
  98. </if>
  99. <if test="methodDescription != null and methodDescription != ''">
  100. and METHOD_DESCRIPTION LIKE '%${methodDescription}%'
  101. </if>
  102. <if test="exeCost != null">
  103. and EXE_COST = #{exeCost}
  104. </if>
  105. <if test="filePath != null and filePath != ''">
  106. and FILE_PATH LIKE '%${filePath}%'
  107. </if>
  108. <if test="insertTime != null">
  109. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  110. </if>
  111. <if test="insertUsername != null and insertUsername != ''">
  112. and INSERT_USERNAME LIKE '%${insertUsername}%'
  113. </if>
  114. <if test="remark != null and remark != ''">
  115. and REMARK LIKE '%${remark}%'
  116. </if>
  117. <if test="datagram1 != null and datagram1 != ''">
  118. and DATAGRAM1 LIKE '%${datagram1}%'
  119. </if>
  120. <if test="datagram2 != null and datagram2 != ''">
  121. and DATAGRAM2 LIKE '%${datagram2}%'
  122. </if>
  123. <if test="datagram3 != null and datagram3 != ''">
  124. and DATAGRAM3 LIKE '%${datagram3}%'
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  129. delete from LOG_RESULT
  130. where LOG_ID = #{logId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from LOG_RESULT
  134. where 1!=1
  135. <if test="logContent != null and logContent != ''">
  136. or LOG_CONTENT = #{logContent}
  137. </if>
  138. <if test="foreignKeyId != null">
  139. or FOREIGN_KEY_ID = #{foreignKeyId}
  140. </if>
  141. <if test="foreignKeyType != null and foreignKeyType != ''">
  142. or FOREIGN_KEY_TYPE = #{foreignKeyType}
  143. </if>
  144. <if test="methodName != null and methodName != ''">
  145. or METHOD_NAME = #{methodName}
  146. </if>
  147. <if test="methodDescription != null and methodDescription != ''">
  148. or METHOD_DESCRIPTION = #{methodDescription}
  149. </if>
  150. <if test="exeCost != null">
  151. or EXE_COST = #{exeCost}
  152. </if>
  153. <if test="filePath != null and filePath != ''">
  154. or FILE_PATH = #{filePath}
  155. </if>
  156. <if test="insertTime != null">
  157. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  158. </if>
  159. <if test="insertUsername != null and insertUsername != ''">
  160. or INSERT_USERNAME = #{insertUsername}
  161. </if>
  162. <if test="remark != null and remark != ''">
  163. or REMARK = #{remark}
  164. </if>
  165. <if test="datagram1 != null and datagram1 != ''">
  166. or DATAGRAM1 = #{datagram1}
  167. </if>
  168. <if test="datagram2 != null and datagram2 != ''">
  169. or DATAGRAM2 = #{datagram2}
  170. </if>
  171. <if test="datagram3 != null and datagram3 != ''">
  172. or DATAGRAM3 = #{datagram3}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.LogResult">
  176. insert into LOG_RESULT (LOG_ID, LOG_CONTENT, FOREIGN_KEY_ID,
  177. FOREIGN_KEY_TYPE, METHOD_NAME, METHOD_DESCRIPTION,
  178. EXE_COST, FILE_PATH, INSERT_TIME,
  179. INSERT_USERNAME, REMARK, DATAGRAM1,
  180. DATAGRAM2, DATAGRAM3)
  181. values (#{logId,jdbcType=DECIMAL}, #{logContent,jdbcType=VARCHAR}, #{foreignKeyId,jdbcType=DECIMAL},
  182. #{foreignKeyType,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, #{methodDescription,jdbcType=VARCHAR},
  183. #{exeCost,jdbcType=DECIMAL}, #{filePath,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  184. #{insertUsername,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{datagram1,jdbcType=VARCHAR},
  185. #{datagram2,jdbcType=VARCHAR}, #{datagram3,jdbcType=VARCHAR})
  186. </insert>
  187. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.LogResult">
  188. insert into LOG_RESULT
  189. <trim prefix="(" suffix=")" suffixOverrides=",">
  190. <if test="logId != null">
  191. LOG_ID,
  192. </if>
  193. <if test="logContent != null">
  194. LOG_CONTENT,
  195. </if>
  196. <if test="foreignKeyId != null">
  197. FOREIGN_KEY_ID,
  198. </if>
  199. <if test="foreignKeyType != null">
  200. FOREIGN_KEY_TYPE,
  201. </if>
  202. <if test="methodName != null">
  203. METHOD_NAME,
  204. </if>
  205. <if test="methodDescription != null">
  206. METHOD_DESCRIPTION,
  207. </if>
  208. <if test="exeCost != null">
  209. EXE_COST,
  210. </if>
  211. <if test="filePath != null">
  212. FILE_PATH,
  213. </if>
  214. <if test="insertTime != null">
  215. INSERT_TIME,
  216. </if>
  217. <if test="insertUsername != null">
  218. INSERT_USERNAME,
  219. </if>
  220. <if test="remark != null">
  221. REMARK,
  222. </if>
  223. <if test="datagram1 != null">
  224. DATAGRAM1,
  225. </if>
  226. <if test="datagram2 != null">
  227. DATAGRAM2,
  228. </if>
  229. <if test="datagram3 != null">
  230. DATAGRAM3,
  231. </if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="logId != null">
  235. #{logId,jdbcType=DECIMAL},
  236. </if>
  237. <if test="logContent != null">
  238. #{logContent,jdbcType=VARCHAR},
  239. </if>
  240. <if test="foreignKeyId != null">
  241. #{foreignKeyId,jdbcType=DECIMAL},
  242. </if>
  243. <if test="foreignKeyType != null">
  244. #{foreignKeyType,jdbcType=VARCHAR},
  245. </if>
  246. <if test="methodName != null">
  247. #{methodName,jdbcType=VARCHAR},
  248. </if>
  249. <if test="methodDescription != null">
  250. #{methodDescription,jdbcType=VARCHAR},
  251. </if>
  252. <if test="exeCost != null">
  253. #{exeCost,jdbcType=DECIMAL},
  254. </if>
  255. <if test="filePath != null">
  256. #{filePath,jdbcType=VARCHAR},
  257. </if>
  258. <if test="insertTime != null">
  259. #{insertTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="insertUsername != null">
  262. #{insertUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="remark != null">
  265. #{remark,jdbcType=VARCHAR},
  266. </if>
  267. <if test="datagram1 != null">
  268. #{datagram1,jdbcType=VARCHAR},
  269. </if>
  270. <if test="datagram2 != null">
  271. #{datagram2,jdbcType=VARCHAR},
  272. </if>
  273. <if test="datagram3 != null">
  274. #{datagram3,jdbcType=VARCHAR},
  275. </if>
  276. </trim>
  277. </insert>
  278. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.LogResult">
  279. update LOG_RESULT
  280. set LOG_CONTENT = #{logContent,jdbcType=VARCHAR},
  281. FOREIGN_KEY_ID = #{foreignKeyId,jdbcType=DECIMAL},
  282. FOREIGN_KEY_TYPE = #{foreignKeyType,jdbcType=VARCHAR},
  283. METHOD_NAME = #{methodName,jdbcType=VARCHAR},
  284. METHOD_DESCRIPTION = #{methodDescription,jdbcType=VARCHAR},
  285. EXE_COST = #{exeCost,jdbcType=DECIMAL},
  286. FILE_PATH = #{filePath,jdbcType=VARCHAR},
  287. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  288. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  289. REMARK = #{remark,jdbcType=VARCHAR},
  290. DATAGRAM1 = #{datagram1,jdbcType=VARCHAR},
  291. DATAGRAM2 = #{datagram2,jdbcType=VARCHAR},
  292. DATAGRAM3 = #{datagram3,jdbcType=VARCHAR}
  293. where LOG_ID = #{logId,jdbcType=DECIMAL}
  294. </update>
  295. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.LogResult">
  296. update LOG_RESULT
  297. <set>
  298. <if test="logContent != null">
  299. LOG_CONTENT = #{logContent,jdbcType=VARCHAR},
  300. </if>
  301. <if test="foreignKeyId != null">
  302. FOREIGN_KEY_ID = #{foreignKeyId,jdbcType=DECIMAL},
  303. </if>
  304. <if test="foreignKeyType != null">
  305. FOREIGN_KEY_TYPE = #{foreignKeyType,jdbcType=VARCHAR},
  306. </if>
  307. <if test="methodName != null">
  308. METHOD_NAME = #{methodName,jdbcType=VARCHAR},
  309. </if>
  310. <if test="methodDescription != null">
  311. METHOD_DESCRIPTION = #{methodDescription,jdbcType=VARCHAR},
  312. </if>
  313. <if test="exeCost != null">
  314. EXE_COST = #{exeCost,jdbcType=DECIMAL},
  315. </if>
  316. <if test="filePath != null">
  317. FILE_PATH = #{filePath,jdbcType=VARCHAR},
  318. </if>
  319. <if test="insertTime != null">
  320. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  321. </if>
  322. <if test="insertUsername != null">
  323. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  324. </if>
  325. <if test="remark != null">
  326. REMARK = #{remark,jdbcType=VARCHAR},
  327. </if>
  328. <if test="datagram1 != null">
  329. DATAGRAM1 = #{datagram1,jdbcType=VARCHAR},
  330. </if>
  331. <if test="datagram2 != null">
  332. DATAGRAM2 = #{datagram2,jdbcType=VARCHAR},
  333. </if>
  334. <if test="datagram3 != null">
  335. DATAGRAM3 = #{datagram3,jdbcType=VARCHAR},
  336. </if>
  337. </set>
  338. where LOG_ID = #{logId,jdbcType=DECIMAL}
  339. </update>
  340. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  341. <include refid="select"/>
  342. where LOG_ID = #{logId,jdbcType=DECIMAL}
  343. </select>
  344. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  345. <include refid="select"/>
  346. <include refid="where"/>
  347. </select>
  348. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  349. <include refid="select"/>
  350. <include refid="whereLike"/>
  351. </select>
  352. <insert id="batchInsert" parameterType="java.util.List">
  353. insert into LOG_RESULT
  354. (LOG_ID,
  355. LOG_CONTENT, FOREIGN_KEY_ID, FOREIGN_KEY_TYPE,
  356. METHOD_NAME, METHOD_DESCRIPTION,
  357. EXE_COST, FILE_PATH, INSERT_TIME,
  358. INSERT_USERNAME, REMARK, DATAGRAM1,
  359. DATAGRAM2, DATAGRAM3)
  360. ( <foreach collection="list" item="item" separator="union all">
  361. select
  362. #{item.logId,jdbcType=DECIMAL},
  363. #{item.logContent,jdbcType=VARCHAR}, #{item.foreignKeyId,jdbcType=DECIMAL}, #{item.foreignKeyType,jdbcType=VARCHAR},
  364. #{item.methodName,jdbcType=VARCHAR}, #{item.methodDescription,jdbcType=VARCHAR},
  365. #{item.exeCost,jdbcType=DECIMAL}, #{item.filePath,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  366. #{item.insertUsername,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.datagram1,jdbcType=VARCHAR},
  367. #{item.datagram2,jdbcType=VARCHAR}, #{item.datagram3,jdbcType=VARCHAR} from dual
  368. </foreach> )
  369. </insert>
  370. <update id="batchUpdate" parameterType="java.util.List">
  371. update LOG_RESULT
  372. set
  373. LOG_ID=
  374. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  375. when #{item.logId,jdbcType=DECIMAL} then #{item.logId,jdbcType=DECIMAL}
  376. </foreach>
  377. ,LOG_CONTENT=
  378. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  379. when #{item.logId,jdbcType=DECIMAL} then #{item.logContent,jdbcType=VARCHAR}
  380. </foreach>
  381. ,FOREIGN_KEY_ID=
  382. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  383. when #{item.logId,jdbcType=DECIMAL} then #{item.foreignKeyId,jdbcType=DECIMAL}
  384. </foreach>
  385. ,FOREIGN_KEY_TYPE=
  386. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  387. when #{item.logId,jdbcType=DECIMAL} then #{item.foreignKeyType,jdbcType=VARCHAR}
  388. </foreach>
  389. ,METHOD_NAME=
  390. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  391. when #{item.logId,jdbcType=DECIMAL} then #{item.methodName,jdbcType=VARCHAR}
  392. </foreach>
  393. ,METHOD_DESCRIPTION=
  394. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  395. when #{item.logId,jdbcType=DECIMAL} then #{item.methodDescription,jdbcType=VARCHAR}
  396. </foreach>
  397. ,EXE_COST=
  398. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  399. when #{item.logId,jdbcType=DECIMAL} then #{item.exeCost,jdbcType=DECIMAL}
  400. </foreach>
  401. ,FILE_PATH=
  402. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  403. when #{item.logId,jdbcType=DECIMAL} then #{item.filePath,jdbcType=VARCHAR}
  404. </foreach>
  405. ,INSERT_TIME=
  406. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  407. when #{item.logId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  408. </foreach>
  409. ,INSERT_USERNAME=
  410. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  411. when #{item.logId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  412. </foreach>
  413. ,REMARK=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  415. when #{item.logId,jdbcType=DECIMAL} then #{item.remark,jdbcType=VARCHAR}
  416. </foreach>
  417. ,DATAGRAM1=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  419. when #{item.logId,jdbcType=DECIMAL} then #{item.datagram1,jdbcType=VARCHAR}
  420. </foreach>
  421. ,DATAGRAM2=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  423. when #{item.logId,jdbcType=DECIMAL} then #{item.datagram2,jdbcType=VARCHAR}
  424. </foreach>
  425. ,DATAGRAM3=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case LOG_ID" close="end">
  427. when #{item.logId,jdbcType=DECIMAL} then #{item.datagram3,jdbcType=VARCHAR}
  428. </foreach>
  429. where LOG_ID in
  430. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  431. #{item.logId,jdbcType=DECIMAL}
  432. </foreach>
  433. </update>
  434. <delete id="batchDelete" parameterType="java.util.List">
  435. delete from LOG_RESULT
  436. where LOG_ID in
  437. <foreach collection="list" item="id" open="(" close=")" separator=",">
  438. #{id}
  439. </foreach>
  440. </delete>
  441. <!-- 友情提示!!!-->
  442. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  443. </mapper>