PublicReleaseMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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.PublicReleaseMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicRelease">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="uid" jdbcType="VARCHAR" property="uid" />
  12. <result column="aid" jdbcType="VARCHAR" property="aid" />
  13. <result column="release_start" jdbcType="TIMESTAMP" property="releaseStart" />
  14. <result column="release_end" jdbcType="TIMESTAMP" property="releaseEnd" />
  15. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  16. <result column="user_name" jdbcType="VARCHAR" property="userName" />
  17. <result column="longitude" jdbcType="VARCHAR" property="longitude" />
  18. <result column="latitude" jdbcType="VARCHAR" property="latitude" />
  19. <result column="status" jdbcType="INTEGER" property="status" />
  20. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  21. <result column="clock_in" jdbcType="INTEGER" property="clockIn" />
  22. <result column="clock_in_time" jdbcType="TIMESTAMP" property="clockInTime" />
  23. <result column="pid" jdbcType="VARCHAR" property="pid" />
  24. <result column="pname" jdbcType="VARCHAR" property="pname" />
  25. <result column="ufid" jdbcType="VARCHAR" property="ufid" />
  26. <result column="duration" jdbcType="DOUBLE" property="duration" />
  27. </resultMap>
  28. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.PublicRelease">
  29. <!--
  30. WARNING - @mbg.generated
  31. This element is automatically generated by MyBatis Generator, do not modify.
  32. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  33. -->
  34. <result column="annex_url" jdbcType="LONGVARCHAR" property="annexUrl" />
  35. <result column="photo_url" jdbcType="LONGVARCHAR" property="photoUrl" />
  36. </resultMap>
  37. <sql id="Base_Column_List">
  38. <!--
  39. WARNING - @mbg.generated
  40. This element is automatically generated by MyBatis Generator, do not modify.
  41. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  42. -->
  43. id, `uid`, aid, release_start, release_end, remarks, user_name, longitude, latitude,
  44. `status`, create_time, clock_in, clock_in_time, pid, pname, ufid, duration
  45. </sql>
  46. <sql id="Blob_Column_List">
  47. <!--
  48. WARNING - @mbg.generated
  49. This element is automatically generated by MyBatis Generator, do not modify.
  50. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  51. -->
  52. annex_url, photo_url
  53. </sql>
  54. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  55. <!--
  56. WARNING - @mbg.generated
  57. This element is automatically generated by MyBatis Generator, do not modify.
  58. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  59. -->
  60. select
  61. <include refid="Base_Column_List" />
  62. ,
  63. <include refid="Blob_Column_List" />
  64. from public_release
  65. where id = #{id,jdbcType=INTEGER}
  66. </select>
  67. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  68. <!--
  69. WARNING - @mbg.generated
  70. This element is automatically generated by MyBatis Generator, do not modify.
  71. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  72. -->
  73. delete from public_release
  74. where id = #{id,jdbcType=INTEGER}
  75. </delete>
  76. <insert id="insert" parameterType="com.goafanti.common.model.PublicRelease">
  77. <!--
  78. WARNING - @mbg.generated
  79. This element is automatically generated by MyBatis Generator, do not modify.
  80. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  81. -->
  82. insert into public_release (id, `uid`, aid,
  83. release_start, release_end, remarks,
  84. user_name, longitude, latitude,
  85. `status`, create_time, clock_in,
  86. clock_in_time, pid, pname,
  87. ufid, duration, annex_url,
  88. photo_url)
  89. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  90. #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
  91. #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
  92. #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER},
  93. #{clockInTime,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR},
  94. #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, #{annexUrl,jdbcType=LONGVARCHAR},
  95. #{photoUrl,jdbcType=LONGVARCHAR})
  96. </insert>
  97. <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicRelease">
  98. <!--
  99. WARNING - @mbg.generated
  100. This element is automatically generated by MyBatis Generator, do not modify.
  101. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  102. -->
  103. insert into public_release
  104. <trim prefix="(" suffix=")" suffixOverrides=",">
  105. <if test="id != null">
  106. id,
  107. </if>
  108. <if test="uid != null">
  109. `uid`,
  110. </if>
  111. <if test="aid != null">
  112. aid,
  113. </if>
  114. <if test="releaseStart != null">
  115. release_start,
  116. </if>
  117. <if test="releaseEnd != null">
  118. release_end,
  119. </if>
  120. <if test="remarks != null">
  121. remarks,
  122. </if>
  123. <if test="userName != null">
  124. user_name,
  125. </if>
  126. <if test="longitude != null">
  127. longitude,
  128. </if>
  129. <if test="latitude != null">
  130. latitude,
  131. </if>
  132. <if test="status != null">
  133. `status`,
  134. </if>
  135. <if test="createTime != null">
  136. create_time,
  137. </if>
  138. <if test="clockIn != null">
  139. clock_in,
  140. </if>
  141. <if test="clockInTime != null">
  142. clock_in_time,
  143. </if>
  144. <if test="pid != null">
  145. pid,
  146. </if>
  147. <if test="pname != null">
  148. pname,
  149. </if>
  150. <if test="ufid != null">
  151. ufid,
  152. </if>
  153. <if test="duration != null">
  154. duration,
  155. </if>
  156. <if test="annexUrl != null">
  157. annex_url,
  158. </if>
  159. <if test="photoUrl != null">
  160. photo_url,
  161. </if>
  162. </trim>
  163. <trim prefix="values (" suffix=")" suffixOverrides=",">
  164. <if test="id != null">
  165. #{id,jdbcType=INTEGER},
  166. </if>
  167. <if test="uid != null">
  168. #{uid,jdbcType=VARCHAR},
  169. </if>
  170. <if test="aid != null">
  171. #{aid,jdbcType=VARCHAR},
  172. </if>
  173. <if test="releaseStart != null">
  174. #{releaseStart,jdbcType=TIMESTAMP},
  175. </if>
  176. <if test="releaseEnd != null">
  177. #{releaseEnd,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="remarks != null">
  180. #{remarks,jdbcType=VARCHAR},
  181. </if>
  182. <if test="userName != null">
  183. #{userName,jdbcType=VARCHAR},
  184. </if>
  185. <if test="longitude != null">
  186. #{longitude,jdbcType=VARCHAR},
  187. </if>
  188. <if test="latitude != null">
  189. #{latitude,jdbcType=VARCHAR},
  190. </if>
  191. <if test="status != null">
  192. #{status,jdbcType=INTEGER},
  193. </if>
  194. <if test="createTime != null">
  195. #{createTime,jdbcType=TIMESTAMP},
  196. </if>
  197. <if test="clockIn != null">
  198. #{clockIn,jdbcType=INTEGER},
  199. </if>
  200. <if test="clockInTime != null">
  201. #{clockInTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="pid != null">
  204. #{pid,jdbcType=VARCHAR},
  205. </if>
  206. <if test="pname != null">
  207. #{pname,jdbcType=VARCHAR},
  208. </if>
  209. <if test="ufid != null">
  210. #{ufid,jdbcType=VARCHAR},
  211. </if>
  212. <if test="duration != null">
  213. #{duration,jdbcType=DOUBLE},
  214. </if>
  215. <if test="annexUrl != null">
  216. #{annexUrl,jdbcType=LONGVARCHAR},
  217. </if>
  218. <if test="photoUrl != null">
  219. #{photoUrl,jdbcType=LONGVARCHAR},
  220. </if>
  221. </trim>
  222. </insert>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
  224. <!--
  225. WARNING - @mbg.generated
  226. This element is automatically generated by MyBatis Generator, do not modify.
  227. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  228. -->
  229. update public_release
  230. <set>
  231. <if test="uid != null">
  232. `uid` = #{uid,jdbcType=VARCHAR},
  233. </if>
  234. <if test="aid != null">
  235. aid = #{aid,jdbcType=VARCHAR},
  236. </if>
  237. <if test="releaseStart != null">
  238. release_start = #{releaseStart,jdbcType=TIMESTAMP},
  239. </if>
  240. <if test="releaseEnd != null">
  241. release_end = #{releaseEnd,jdbcType=TIMESTAMP},
  242. </if>
  243. <if test="remarks != null">
  244. remarks = #{remarks,jdbcType=VARCHAR},
  245. </if>
  246. <if test="userName != null">
  247. user_name = #{userName,jdbcType=VARCHAR},
  248. </if>
  249. <if test="longitude != null">
  250. longitude = #{longitude,jdbcType=VARCHAR},
  251. </if>
  252. <if test="latitude != null">
  253. latitude = #{latitude,jdbcType=VARCHAR},
  254. </if>
  255. <if test="status != null">
  256. `status` = #{status,jdbcType=INTEGER},
  257. </if>
  258. <if test="createTime != null">
  259. create_time = #{createTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="clockIn != null">
  262. clock_in = #{clockIn,jdbcType=INTEGER},
  263. </if>
  264. <if test="clockInTime != null">
  265. clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="pid != null">
  268. pid = #{pid,jdbcType=VARCHAR},
  269. </if>
  270. <if test="pname != null">
  271. pname = #{pname,jdbcType=VARCHAR},
  272. </if>
  273. <if test="ufid != null">
  274. ufid = #{ufid,jdbcType=VARCHAR},
  275. </if>
  276. <if test="duration != null">
  277. duration = #{duration,jdbcType=DOUBLE},
  278. </if>
  279. <if test="annexUrl != null">
  280. annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
  281. </if>
  282. <if test="photoUrl != null">
  283. photo_url = #{photoUrl,jdbcType=LONGVARCHAR},
  284. </if>
  285. </set>
  286. where id = #{id,jdbcType=INTEGER}
  287. </update>
  288. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.PublicRelease">
  289. <!--
  290. WARNING - @mbg.generated
  291. This element is automatically generated by MyBatis Generator, do not modify.
  292. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  293. -->
  294. update public_release
  295. set `uid` = #{uid,jdbcType=VARCHAR},
  296. aid = #{aid,jdbcType=VARCHAR},
  297. release_start = #{releaseStart,jdbcType=TIMESTAMP},
  298. release_end = #{releaseEnd,jdbcType=TIMESTAMP},
  299. remarks = #{remarks,jdbcType=VARCHAR},
  300. user_name = #{userName,jdbcType=VARCHAR},
  301. longitude = #{longitude,jdbcType=VARCHAR},
  302. latitude = #{latitude,jdbcType=VARCHAR},
  303. `status` = #{status,jdbcType=INTEGER},
  304. create_time = #{createTime,jdbcType=TIMESTAMP},
  305. clock_in = #{clockIn,jdbcType=INTEGER},
  306. clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
  307. pid = #{pid,jdbcType=VARCHAR},
  308. pname = #{pname,jdbcType=VARCHAR},
  309. ufid = #{ufid,jdbcType=VARCHAR},
  310. duration = #{duration,jdbcType=DOUBLE},
  311. annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
  312. photo_url = #{photoUrl,jdbcType=LONGVARCHAR}
  313. where id = #{id,jdbcType=INTEGER}
  314. </update>
  315. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicRelease">
  316. <!--
  317. WARNING - @mbg.generated
  318. This element is automatically generated by MyBatis Generator, do not modify.
  319. This element was generated on Wed Jun 02 14:39:12 CST 2021.
  320. -->
  321. update public_release
  322. set `uid` = #{uid,jdbcType=VARCHAR},
  323. aid = #{aid,jdbcType=VARCHAR},
  324. release_start = #{releaseStart,jdbcType=TIMESTAMP},
  325. release_end = #{releaseEnd,jdbcType=TIMESTAMP},
  326. remarks = #{remarks,jdbcType=VARCHAR},
  327. user_name = #{userName,jdbcType=VARCHAR},
  328. longitude = #{longitude,jdbcType=VARCHAR},
  329. latitude = #{latitude,jdbcType=VARCHAR},
  330. `status` = #{status,jdbcType=INTEGER},
  331. create_time = #{createTime,jdbcType=TIMESTAMP},
  332. clock_in = #{clockIn,jdbcType=INTEGER},
  333. clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
  334. pid = #{pid,jdbcType=VARCHAR},
  335. pname = #{pname,jdbcType=VARCHAR},
  336. ufid = #{ufid,jdbcType=VARCHAR},
  337. duration = #{duration,jdbcType=DOUBLE}
  338. where id = #{id,jdbcType=INTEGER}
  339. </update>
  340. <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
  341. insert into public_release
  342. <trim prefix="(" suffix=")" suffixOverrides=",">
  343. <if test="id != null">
  344. id,
  345. </if>
  346. <if test="uid != null">
  347. `uid`,
  348. </if>
  349. <if test="aid != null">
  350. aid,
  351. </if>
  352. <if test="releaseStart != null">
  353. release_start,
  354. </if>
  355. <if test="releaseEnd != null">
  356. release_end,
  357. </if>
  358. <if test="remarks != null">
  359. remarks,
  360. </if>
  361. <if test="userName != null">
  362. user_name,
  363. </if>
  364. <if test="longitude != null">
  365. longitude,
  366. </if>
  367. <if test="latitude != null">
  368. latitude,
  369. </if>
  370. <if test="status != null">
  371. `status`,
  372. </if>
  373. <if test="createTime != null">
  374. create_time,
  375. </if>
  376. <if test="clockIn != null">
  377. clock_in,
  378. </if>
  379. <if test="clockInTime != null">
  380. clock_in_time,
  381. </if>
  382. <if test="pid != null">
  383. pid,
  384. </if>
  385. <if test="pname != null">
  386. pname,
  387. </if>
  388. <if test="annexUrl != null">
  389. annex_url,
  390. </if>
  391. <if test="photoUrl != null">
  392. photo_url,
  393. </if>
  394. <if test="duration != null">
  395. duration,
  396. </if>
  397. </trim>
  398. <trim prefix="values (" suffix=")" suffixOverrides=",">
  399. <if test="id != null">
  400. #{id,jdbcType=INTEGER},
  401. </if>
  402. <if test="uid != null">
  403. #{uid,jdbcType=VARCHAR},
  404. </if>
  405. <if test="aid != null">
  406. #{aid,jdbcType=VARCHAR},
  407. </if>
  408. <if test="releaseStart != null">
  409. #{releaseStart,jdbcType=TIMESTAMP},
  410. </if>
  411. <if test="releaseEnd != null">
  412. #{releaseEnd,jdbcType=TIMESTAMP},
  413. </if>
  414. <if test="remarks != null">
  415. #{remarks,jdbcType=VARCHAR},
  416. </if>
  417. <if test="userName != null">
  418. #{userName,jdbcType=VARCHAR},
  419. </if>
  420. <if test="longitude != null">
  421. #{longitude,jdbcType=VARCHAR},
  422. </if>
  423. <if test="latitude != null">
  424. #{latitude,jdbcType=VARCHAR},
  425. </if>
  426. <if test="status != null">
  427. #{status,jdbcType=INTEGER},
  428. </if>
  429. <if test="createTime != null">
  430. #{createTime,jdbcType=TIMESTAMP},
  431. </if>
  432. <if test="clockIn != null">
  433. #{clockIn,jdbcType=INTEGER},
  434. </if>
  435. <if test="clockInTime != null">
  436. #{clockInTime,jdbcType=TIMESTAMP},
  437. </if>
  438. <if test="pid != null">
  439. #{pid,jdbcType=VARCHAR},
  440. </if>
  441. <if test="pname != null">
  442. #{pname,jdbcType=VARCHAR},
  443. </if>
  444. <if test="annexUrl != null">
  445. #{annexUrl,jdbcType=LONGVARCHAR},
  446. </if>
  447. <if test="photoUrl != null">
  448. #{photoUrl,jdbcType=LONGVARCHAR},
  449. </if>
  450. <if test="duration != null">
  451. #{duration,jdbcType=DOUBLE},
  452. </if>
  453. </trim>
  454. <selectKey keyProperty="id" order="AFTER" resultType="int">
  455. SELECT LAST_INSERT_ID()
  456. </selectKey>
  457. </insert>
  458. <select id="listPublicRelease" resultType="com.goafanti.admin.bo.OutPublicReleaseList">
  459. select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
  460. date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
  461. a.latitude ,a.longitude
  462. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  463. where 1=1
  464. <if test="type==0">
  465. and a.aid= #{aid}
  466. </if>
  467. <if test="type==1">
  468. and c.superior_id = #{aid}
  469. </if>
  470. <if test="clockTime !=null">
  471. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  472. </if>
  473. order by a.status,a.create_time
  474. <if test="page_sql!=null">
  475. ${page_sql}
  476. </if>
  477. </select>
  478. <select id="countPublicRelease" resultType="java.lang.Integer">
  479. select count(*)
  480. from public_release a left join admin c on a.aid =c.id
  481. where 1=1
  482. <if test="type==0">
  483. and a.aid= #{aid}
  484. </if>
  485. <if test="type==1">
  486. and c.superior_id = #{aid}
  487. </if>
  488. <if test="clockTime !=null">
  489. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  490. </if>
  491. </select>
  492. <select id="selectByUfid" resultType="com.goafanti.admin.bo.OutPublicRelease">
  493. select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
  494. date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
  495. a.annex_url annexUrl ,a.remarks,a.duration
  496. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  497. where a.ufid= #{id}
  498. </select>
  499. <select id="selectByid" resultType="com.goafanti.admin.bo.OutPublicRelease">
  500. select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
  501. date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
  502. a.annex_url annexUrl ,a.remarks,a.duration
  503. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  504. where a.id= #{id}
  505. </select>
  506. <select id="listPublicStatistics" resultType="com.goafanti.admin.bo.OutPublicStatistics">
  507. select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,b.name
  508. ,sum(if(a.status=2,a.duration,0))duration
  509. from public_release a left join admin b on a.aid =b.id
  510. where 1=1
  511. <if test="aid != null">
  512. and a.aid= #{aid}
  513. </if>
  514. <if test="clockStart != null and clockEnd != null">
  515. and a.clock_in_time between #{clockStart} and #{clockEnd}
  516. </if>
  517. <if test="createStart != null and createEnd !=null">
  518. and a.create_time between #{createStart} and #{createEnd}
  519. </if>
  520. <if test="depId != null">
  521. and b.department_id = #{depId}
  522. </if>
  523. <if test="page_sql!=null">
  524. ${page_sql}
  525. </if>
  526. </select>
  527. <select id="countPublicStatistics" resultType="java.lang.Integer">
  528. select count(*)
  529. from public_release a left join admin b on a.aid =b.id
  530. where 1=1
  531. <if test="aid != null">
  532. and a.aid= #{aid}
  533. </if>
  534. <if test="clockStart != null and clockEnd != null">
  535. and a.clock_in_time between #{clockStart} and #{clockEnd}
  536. </if>
  537. <if test="createStart != null and createEnd !=null">
  538. and a.create_time between #{createStart} and #{createEnd}
  539. </if>
  540. <if test="depId != null">
  541. and b.department_id = #{depId}
  542. </if>
  543. </select>
  544. <select id="listPublicDtails" resultType="com.goafanti.admin.bo.OutPublicDtails">
  545. select b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,
  546. date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds
  547. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  548. where 1=1
  549. <if test="aid != null">
  550. and a.aid= #{aid}
  551. </if>
  552. <if test="uid != null">
  553. and a.uid = #{uid}
  554. </if>
  555. <if test="releaseStart != null and releaseEnd != null">
  556. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  557. </if>
  558. <if test="status != null">
  559. and a.status = #{status}
  560. </if>
  561. <if test="page_sql!=null">
  562. ${page_sql}
  563. </if>
  564. </select>
  565. <select id="countPublicDtails" resultType="java.lang.Integer">
  566. select count(*)
  567. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  568. where 1=1
  569. <if test="aid != null">
  570. and a.aid= #{aid}
  571. </if>
  572. <if test="uid != null">
  573. and a.uid = #{uid}
  574. </if>
  575. <if test="releaseStart != null and releaseEnd != null">
  576. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  577. </if>
  578. <if test="status != null">
  579. and a.status = #{status}
  580. </if>
  581. </select>
  582. </mapper>