RecommenmainMapper.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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.gyee.frame.mapper.auto.RecommenmainMapper">
  4. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Recommenmain">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="RID" jdbcType="VARCHAR" property="rid" />
  10. <result column="ID" jdbcType="DECIMAL" property="id" />
  11. <result column="WTID" jdbcType="VARCHAR" property="wtid" />
  12. <result column="RECODEDATE" jdbcType="TIMESTAMP" property="recodedate" />
  13. <result column="CREATEDATE" jdbcType="TIMESTAMP" property="createdate" />
  14. <result column="SPEED" jdbcType="DECIMAL" property="speed" />
  15. <result column="REASON" jdbcType="VARCHAR" property="reason" />
  16. <result column="ISMAIN" jdbcType="VARCHAR" property="ismain" />
  17. <result column="WOBUGID" jdbcType="VARCHAR" property="wobugid" />
  18. <result column="OPERATION" jdbcType="VARCHAR" property="operation" />
  19. <result column="OPERATIONDATE" jdbcType="TIMESTAMP" property="operationdate" />
  20. <result column="REMARK" jdbcType="VARCHAR" property="remark" />
  21. <result column="BAK1" jdbcType="VARCHAR" property="bak1" />
  22. <result column="BAK2" jdbcType="VARCHAR" property="bak2" />
  23. <result column="WPID" jdbcType="VARCHAR" property="wpid" />
  24. <result column="WTNUM" jdbcType="DECIMAL" property="wtnum" />
  25. <result column="WPNUM" jdbcType="DECIMAL" property="wpnum" />
  26. </resultMap>
  27. <sql id="Example_Where_Clause">
  28. <!--
  29. WARNING - @mbg.generated
  30. This element is automatically generated by MyBatis Generator, do not modify.
  31. -->
  32. <where>
  33. <foreach collection="oredCriteria" item="criteria" separator="or">
  34. <if test="criteria.valid">
  35. <trim prefix="(" prefixOverrides="and" suffix=")">
  36. <foreach collection="criteria.criteria" item="criterion">
  37. <choose>
  38. <when test="criterion.noValue">
  39. and ${criterion.condition}
  40. </when>
  41. <when test="criterion.singleValue">
  42. and ${criterion.condition} #{criterion.value}
  43. </when>
  44. <when test="criterion.betweenValue">
  45. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  46. </when>
  47. <when test="criterion.listValue">
  48. and ${criterion.condition}
  49. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  50. #{listItem}
  51. </foreach>
  52. </when>
  53. </choose>
  54. </foreach>
  55. </trim>
  56. </if>
  57. </foreach>
  58. </where>
  59. </sql>
  60. <sql id="Update_By_Example_Where_Clause">
  61. <!--
  62. WARNING - @mbg.generated
  63. This element is automatically generated by MyBatis Generator, do not modify.
  64. -->
  65. <where>
  66. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  67. <if test="criteria.valid">
  68. <trim prefix="(" prefixOverrides="and" suffix=")">
  69. <foreach collection="criteria.criteria" item="criterion">
  70. <choose>
  71. <when test="criterion.noValue">
  72. and ${criterion.condition}
  73. </when>
  74. <when test="criterion.singleValue">
  75. and ${criterion.condition} #{criterion.value}
  76. </when>
  77. <when test="criterion.betweenValue">
  78. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  79. </when>
  80. <when test="criterion.listValue">
  81. and ${criterion.condition}
  82. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  83. #{listItem}
  84. </foreach>
  85. </when>
  86. </choose>
  87. </foreach>
  88. </trim>
  89. </if>
  90. </foreach>
  91. </where>
  92. </sql>
  93. <sql id="Base_Column_List">
  94. <!--
  95. WARNING - @mbg.generated
  96. This element is automatically generated by MyBatis Generator, do not modify.
  97. -->
  98. RID, ID, WTID, RECODEDATE, CREATEDATE, SPEED, REASON, ISMAIN, WOBUGID, OPERATION,
  99. OPERATIONDATE, REMARK, BAK1, BAK2, WPID, WTNUM, WPNUM
  100. </sql>
  101. <select id="selectByExample" parameterType="com.gyee.frame.model.auto.RecommenmainExample" resultMap="BaseResultMap">
  102. <!--
  103. WARNING - @mbg.generated
  104. This element is automatically generated by MyBatis Generator, do not modify.
  105. -->
  106. select
  107. <if test="distinct">
  108. distinct
  109. </if>
  110. <include refid="Base_Column_List" />
  111. from RECOMMENMAIN
  112. <if test="_parameter != null">
  113. <include refid="Example_Where_Clause" />
  114. </if>
  115. <if test="orderByClause != null">
  116. order by ${orderByClause}
  117. </if>
  118. </select>
  119. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  120. <!--
  121. WARNING - @mbg.generated
  122. This element is automatically generated by MyBatis Generator, do not modify.
  123. -->
  124. select
  125. <include refid="Base_Column_List" />
  126. from RECOMMENMAIN
  127. where RID = #{rid,jdbcType=VARCHAR}
  128. </select>
  129. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  130. <!--
  131. WARNING - @mbg.generated
  132. This element is automatically generated by MyBatis Generator, do not modify.
  133. -->
  134. delete from RECOMMENMAIN
  135. where RID = #{rid,jdbcType=VARCHAR}
  136. </delete>
  137. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.RecommenmainExample">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. -->
  142. delete from RECOMMENMAIN
  143. <if test="_parameter != null">
  144. <include refid="Example_Where_Clause" />
  145. </if>
  146. </delete>
  147. <insert id="insert" parameterType="com.gyee.frame.model.auto.Recommenmain">
  148. <!--
  149. WARNING - @mbg.generated
  150. This element is automatically generated by MyBatis Generator, do not modify.
  151. -->
  152. insert into RECOMMENMAIN (RID, ID, WTID,
  153. RECODEDATE, CREATEDATE, SPEED,
  154. REASON, ISMAIN, WOBUGID,
  155. OPERATION, OPERATIONDATE, REMARK,
  156. BAK1, BAK2, WPID, WTNUM,
  157. WPNUM)
  158. values (#{rid,jdbcType=VARCHAR}, #{id,jdbcType=DECIMAL}, #{wtid,jdbcType=VARCHAR},
  159. #{recodedate,jdbcType=TIMESTAMP}, #{createdate,jdbcType=TIMESTAMP}, #{speed,jdbcType=DECIMAL},
  160. #{reason,jdbcType=VARCHAR}, #{ismain,jdbcType=VARCHAR}, #{wobugid,jdbcType=VARCHAR},
  161. #{operation,jdbcType=VARCHAR}, #{operationdate,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR},
  162. #{bak1,jdbcType=VARCHAR}, #{bak2,jdbcType=VARCHAR}, #{wpid,jdbcType=VARCHAR}, #{wtnum,jdbcType=DECIMAL},
  163. #{wpnum,jdbcType=DECIMAL})
  164. </insert>
  165. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Recommenmain">
  166. <!--
  167. WARNING - @mbg.generated
  168. This element is automatically generated by MyBatis Generator, do not modify.
  169. -->
  170. insert into RECOMMENMAIN
  171. <trim prefix="(" suffix=")" suffixOverrides=",">
  172. <if test="rid != null">
  173. RID,
  174. </if>
  175. <if test="id != null">
  176. ID,
  177. </if>
  178. <if test="wtid != null">
  179. WTID,
  180. </if>
  181. <if test="recodedate != null">
  182. RECODEDATE,
  183. </if>
  184. <if test="createdate != null">
  185. CREATEDATE,
  186. </if>
  187. <if test="speed != null">
  188. SPEED,
  189. </if>
  190. <if test="reason != null">
  191. REASON,
  192. </if>
  193. <if test="ismain != null">
  194. ISMAIN,
  195. </if>
  196. <if test="wobugid != null">
  197. WOBUGID,
  198. </if>
  199. <if test="operation != null">
  200. OPERATION,
  201. </if>
  202. <if test="operationdate != null">
  203. OPERATIONDATE,
  204. </if>
  205. <if test="remark != null">
  206. REMARK,
  207. </if>
  208. <if test="bak1 != null">
  209. BAK1,
  210. </if>
  211. <if test="bak2 != null">
  212. BAK2,
  213. </if>
  214. <if test="wpid != null">
  215. WPID,
  216. </if>
  217. <if test="wtnum != null">
  218. WTNUM,
  219. </if>
  220. <if test="wpnum != null">
  221. WPNUM,
  222. </if>
  223. </trim>
  224. <trim prefix="values (" suffix=")" suffixOverrides=",">
  225. <if test="rid != null">
  226. #{rid,jdbcType=VARCHAR},
  227. </if>
  228. <if test="id != null">
  229. #{id,jdbcType=DECIMAL},
  230. </if>
  231. <if test="wtid != null">
  232. #{wtid,jdbcType=VARCHAR},
  233. </if>
  234. <if test="recodedate != null">
  235. #{recodedate,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="createdate != null">
  238. #{createdate,jdbcType=TIMESTAMP},
  239. </if>
  240. <if test="speed != null">
  241. #{speed,jdbcType=DECIMAL},
  242. </if>
  243. <if test="reason != null">
  244. #{reason,jdbcType=VARCHAR},
  245. </if>
  246. <if test="ismain != null">
  247. #{ismain,jdbcType=VARCHAR},
  248. </if>
  249. <if test="wobugid != null">
  250. #{wobugid,jdbcType=VARCHAR},
  251. </if>
  252. <if test="operation != null">
  253. #{operation,jdbcType=VARCHAR},
  254. </if>
  255. <if test="operationdate != null">
  256. #{operationdate,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="remark != null">
  259. #{remark,jdbcType=VARCHAR},
  260. </if>
  261. <if test="bak1 != null">
  262. #{bak1,jdbcType=VARCHAR},
  263. </if>
  264. <if test="bak2 != null">
  265. #{bak2,jdbcType=VARCHAR},
  266. </if>
  267. <if test="wpid != null">
  268. #{wpid,jdbcType=VARCHAR},
  269. </if>
  270. <if test="wtnum != null">
  271. #{wtnum,jdbcType=DECIMAL},
  272. </if>
  273. <if test="wpnum != null">
  274. #{wpnum,jdbcType=DECIMAL},
  275. </if>
  276. </trim>
  277. </insert>
  278. <select id="countByExample" parameterType="com.gyee.frame.model.auto.RecommenmainExample" resultType="java.lang.Long">
  279. <!--
  280. WARNING - @mbg.generated
  281. This element is automatically generated by MyBatis Generator, do not modify.
  282. -->
  283. select count(*) from RECOMMENMAIN
  284. <if test="_parameter != null">
  285. <include refid="Example_Where_Clause" />
  286. </if>
  287. </select>
  288. <update id="updateByExampleSelective" parameterType="map">
  289. <!--
  290. WARNING - @mbg.generated
  291. This element is automatically generated by MyBatis Generator, do not modify.
  292. -->
  293. update RECOMMENMAIN
  294. <set>
  295. <if test="record.rid != null">
  296. RID = #{record.rid,jdbcType=VARCHAR},
  297. </if>
  298. <if test="record.id != null">
  299. ID = #{record.id,jdbcType=DECIMAL},
  300. </if>
  301. <if test="record.wtid != null">
  302. WTID = #{record.wtid,jdbcType=VARCHAR},
  303. </if>
  304. <if test="record.recodedate != null">
  305. RECODEDATE = #{record.recodedate,jdbcType=TIMESTAMP},
  306. </if>
  307. <if test="record.createdate != null">
  308. CREATEDATE = #{record.createdate,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="record.speed != null">
  311. SPEED = #{record.speed,jdbcType=DECIMAL},
  312. </if>
  313. <if test="record.reason != null">
  314. REASON = #{record.reason,jdbcType=VARCHAR},
  315. </if>
  316. <if test="record.ismain != null">
  317. ISMAIN = #{record.ismain,jdbcType=VARCHAR},
  318. </if>
  319. <if test="record.wobugid != null">
  320. WOBUGID = #{record.wobugid,jdbcType=VARCHAR},
  321. </if>
  322. <if test="record.operation != null">
  323. OPERATION = #{record.operation,jdbcType=VARCHAR},
  324. </if>
  325. <if test="record.operationdate != null">
  326. OPERATIONDATE = #{record.operationdate,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="record.remark != null">
  329. REMARK = #{record.remark,jdbcType=VARCHAR},
  330. </if>
  331. <if test="record.bak1 != null">
  332. BAK1 = #{record.bak1,jdbcType=VARCHAR},
  333. </if>
  334. <if test="record.bak2 != null">
  335. BAK2 = #{record.bak2,jdbcType=VARCHAR},
  336. </if>
  337. <if test="record.wpid != null">
  338. WPID = #{record.wpid,jdbcType=VARCHAR},
  339. </if>
  340. <if test="record.wtnum != null">
  341. WTNUM = #{record.wtnum,jdbcType=DECIMAL},
  342. </if>
  343. <if test="record.wpnum != null">
  344. WPNUM = #{record.wpnum,jdbcType=DECIMAL},
  345. </if>
  346. </set>
  347. <if test="_parameter != null">
  348. <include refid="Update_By_Example_Where_Clause" />
  349. </if>
  350. </update>
  351. <update id="updateByExample" parameterType="map">
  352. <!--
  353. WARNING - @mbg.generated
  354. This element is automatically generated by MyBatis Generator, do not modify.
  355. -->
  356. update RECOMMENMAIN
  357. set RID = #{record.rid,jdbcType=VARCHAR},
  358. ID = #{record.id,jdbcType=DECIMAL},
  359. WTID = #{record.wtid,jdbcType=VARCHAR},
  360. RECODEDATE = #{record.recodedate,jdbcType=TIMESTAMP},
  361. CREATEDATE = #{record.createdate,jdbcType=TIMESTAMP},
  362. SPEED = #{record.speed,jdbcType=DECIMAL},
  363. REASON = #{record.reason,jdbcType=VARCHAR},
  364. ISMAIN = #{record.ismain,jdbcType=VARCHAR},
  365. WOBUGID = #{record.wobugid,jdbcType=VARCHAR},
  366. OPERATION = #{record.operation,jdbcType=VARCHAR},
  367. OPERATIONDATE = #{record.operationdate,jdbcType=TIMESTAMP},
  368. REMARK = #{record.remark,jdbcType=VARCHAR},
  369. BAK1 = #{record.bak1,jdbcType=VARCHAR},
  370. BAK2 = #{record.bak2,jdbcType=VARCHAR},
  371. WPID = #{record.wpid,jdbcType=VARCHAR},
  372. WTNUM = #{record.wtnum,jdbcType=DECIMAL},
  373. WPNUM = #{record.wpnum,jdbcType=DECIMAL}
  374. <if test="_parameter != null">
  375. <include refid="Update_By_Example_Where_Clause" />
  376. </if>
  377. </update>
  378. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Recommenmain">
  379. <!--
  380. WARNING - @mbg.generated
  381. This element is automatically generated by MyBatis Generator, do not modify.
  382. -->
  383. update RECOMMENMAIN
  384. <set>
  385. <if test="id != null">
  386. ID = #{id,jdbcType=DECIMAL},
  387. </if>
  388. <if test="wtid != null">
  389. WTID = #{wtid,jdbcType=VARCHAR},
  390. </if>
  391. <if test="recodedate != null">
  392. RECODEDATE = #{recodedate,jdbcType=TIMESTAMP},
  393. </if>
  394. <if test="createdate != null">
  395. CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
  396. </if>
  397. <if test="speed != null">
  398. SPEED = #{speed,jdbcType=DECIMAL},
  399. </if>
  400. <if test="reason != null">
  401. REASON = #{reason,jdbcType=VARCHAR},
  402. </if>
  403. <if test="ismain != null">
  404. ISMAIN = #{ismain,jdbcType=VARCHAR},
  405. </if>
  406. <if test="wobugid != null">
  407. WOBUGID = #{wobugid,jdbcType=VARCHAR},
  408. </if>
  409. <if test="operation != null">
  410. OPERATION = #{operation,jdbcType=VARCHAR},
  411. </if>
  412. <if test="operationdate != null">
  413. OPERATIONDATE = #{operationdate,jdbcType=TIMESTAMP},
  414. </if>
  415. <if test="remark != null">
  416. REMARK = #{remark,jdbcType=VARCHAR},
  417. </if>
  418. <if test="bak1 != null">
  419. BAK1 = #{bak1,jdbcType=VARCHAR},
  420. </if>
  421. <if test="bak2 != null">
  422. BAK2 = #{bak2,jdbcType=VARCHAR},
  423. </if>
  424. <if test="wpid != null">
  425. WPID = #{wpid,jdbcType=VARCHAR},
  426. </if>
  427. <if test="wtnum != null">
  428. WTNUM = #{wtnum,jdbcType=DECIMAL},
  429. </if>
  430. <if test="wpnum != null">
  431. WPNUM = #{wpnum,jdbcType=DECIMAL},
  432. </if>
  433. </set>
  434. where RID = #{rid,jdbcType=VARCHAR}
  435. </update>
  436. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Recommenmain">
  437. <!--
  438. WARNING - @mbg.generated
  439. This element is automatically generated by MyBatis Generator, do not modify.
  440. -->
  441. update RECOMMENMAIN
  442. set ID = #{id,jdbcType=DECIMAL},
  443. WTID = #{wtid,jdbcType=VARCHAR},
  444. RECODEDATE = #{recodedate,jdbcType=TIMESTAMP},
  445. CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
  446. SPEED = #{speed,jdbcType=DECIMAL},
  447. REASON = #{reason,jdbcType=VARCHAR},
  448. ISMAIN = #{ismain,jdbcType=VARCHAR},
  449. WOBUGID = #{wobugid,jdbcType=VARCHAR},
  450. OPERATION = #{operation,jdbcType=VARCHAR},
  451. OPERATIONDATE = #{operationdate,jdbcType=TIMESTAMP},
  452. REMARK = #{remark,jdbcType=VARCHAR},
  453. BAK1 = #{bak1,jdbcType=VARCHAR},
  454. BAK2 = #{bak2,jdbcType=VARCHAR},
  455. WPID = #{wpid,jdbcType=VARCHAR},
  456. WTNUM = #{wtnum,jdbcType=DECIMAL},
  457. WPNUM = #{wpnum,jdbcType=DECIMAL}
  458. where RID = #{rid,jdbcType=VARCHAR}
  459. </update>
  460. <select id="getRecommenmainDay" resultType="com.gyee.frame.model.auto.Recommenmain">
  461. select * from recommenmain t where t.rid in
  462. (select max(rid) from recommenmain where ismain=#{ismain} and recodedate >= #{beginDate} and recodedate &lt; #{endDate} group by wtid )
  463. order by t.recodedate
  464. </select>
  465. <select id="getRecommenmainTotal" resultType="com.gyee.frame.model.custom.RecommenmainVo">
  466. select t.wtid wtId ,count(t.wtid) nums from recommenmain t where
  467. t.recodedate >= to_date('${beginDate}','YYYY-MM-DD HH24:MI:SS')
  468. and t.recodedate &lt; to_date('${endDate}','YYYY-MM-DD HH24:MI:SS')
  469. <if test="wpId != null">
  470. and wpid = #{wpId,jdbcType=VARCHAR}
  471. </if>
  472. and wpid !='QS_FDC'
  473. group by t.wtid order by nums desc
  474. </select>
  475. </mapper>