PublicReleaseMapper.xml 21 KB

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