PublicReleaseMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  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. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="uid" jdbcType="VARCHAR" property="uid" />
  7. <result column="aid" jdbcType="VARCHAR" property="aid" />
  8. <result column="release_start" jdbcType="TIMESTAMP" property="releaseStart" />
  9. <result column="release_end" jdbcType="TIMESTAMP" property="releaseEnd" />
  10. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  11. <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
  12. <result column="user_name" jdbcType="VARCHAR" property="userName" />
  13. <result column="longitude" jdbcType="VARCHAR" property="longitude" />
  14. <result column="latitude" jdbcType="VARCHAR" property="latitude" />
  15. <result column="status" jdbcType="INTEGER" property="status" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="clock_in" jdbcType="INTEGER" property="clockIn" />
  18. <result column="clock_in_time" jdbcType="TIMESTAMP" property="clockInTime" />
  19. <result column="photo_url" jdbcType="VARCHAR" property="photoUrl" />
  20. <result column="pid" jdbcType="VARCHAR" property="pid" />
  21. <result column="pname" jdbcType="VARCHAR" property="pname" />
  22. <result column="ufid" jdbcType="VARCHAR" property="ufid" />
  23. <result column="duration" jdbcType="DOUBLE" property="duration" />
  24. <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
  25. <result column="new_user" jdbcType="INTEGER" property="newUser" />
  26. <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
  27. <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
  28. <result column="supplement" jdbcType="VARCHAR" property="supplement" />
  29. <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
  30. <result column="plan" jdbcType="VARCHAR" property="plan" />
  31. <result column="expected_effect" jdbcType="VARCHAR" property="expectedEffect" />
  32. <result column="next_plan" jdbcType="VARCHAR" property="nextPlan" />
  33. <result column="type" jdbcType="INTEGER" property="type" />
  34. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  35. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  36. <result column="update_status" jdbcType="INTEGER" property="updateStatus" />
  37. <result column="assist" jdbcType="INTEGER" property="assist" />
  38. <result column="assist_aid" jdbcType="VARCHAR" property="assistAid" />
  39. <result column="assist_aid_name" jdbcType="VARCHAR" property="assistAidName" />
  40. <result column="main_id" jdbcType="INTEGER" property="mainId" />
  41. <result column="main_name" jdbcType="VARCHAR" property="mainName" />
  42. <result column="clock_in_remarks" jdbcType="VARCHAR" property="clockInRemarks" />
  43. <result column="reject_name" jdbcType="VARCHAR" property="rejectName" />
  44. <result column="assistant_aid" jdbcType="VARCHAR" property="assistantAid" />
  45. <result column="assistant_name" jdbcType="VARCHAR" property="assistantName" />
  46. </resultMap>
  47. <sql id="Base_Column_List">
  48. id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude,
  49. latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname,
  50. ufid, duration, valid_date, new_user, sign_sum, main_status, supplement, audit_info,
  51. `plan`, expected_effect, next_plan, `type`, order_no, update_time, update_status,
  52. assist, assist_aid, assist_aid_name, main_id, main_name, clock_in_remarks, reject_name,
  53. assistant_aid, assistant_name
  54. </sql>
  55. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  56. select
  57. <include refid="Base_Column_List" />
  58. from public_release
  59. where id = #{id,jdbcType=INTEGER}
  60. </select>
  61. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  62. delete from public_release
  63. where id = #{id,jdbcType=INTEGER}
  64. </delete>
  65. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
  66. insert into public_release (id, `uid`, aid,
  67. release_start, release_end, remarks,
  68. annex_url, user_name, longitude,
  69. latitude, `status`, create_time,
  70. clock_in, clock_in_time, photo_url,
  71. pid, pname, ufid, duration,
  72. valid_date, new_user, sign_sum,
  73. main_status, supplement, audit_info,
  74. `plan`, expected_effect, next_plan,
  75. `type`, order_no, update_time,
  76. update_status, assist, assist_aid,
  77. assist_aid_name, main_id, main_name
  78. )
  79. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  80. #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
  81. #{annexUrl,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
  82. #{latitude,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  83. #{clockIn,jdbcType=INTEGER}, #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR},
  84. #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE},
  85. #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER},
  86. #{mainStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR},
  87. #{plan,jdbcType=VARCHAR}, #{expectedEffect,jdbcType=VARCHAR}, #{nextPlan,jdbcType=VARCHAR},
  88. #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  89. #{updateStatus,jdbcType=INTEGER}, #{assist,jdbcType=INTEGER}, #{assistAid,jdbcType=VARCHAR},
  90. #{assistAidName,jdbcType=VARCHAR}, #{mainId,jdbcType=INTEGER}, #{mainName,jdbcType=VARCHAR}
  91. )
  92. </insert>
  93. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
  94. insert into public_release
  95. <trim prefix="(" suffix=")" suffixOverrides=",">
  96. <if test="id != null">
  97. id,
  98. </if>
  99. <if test="uid != null">
  100. `uid`,
  101. </if>
  102. <if test="aid != null">
  103. aid,
  104. </if>
  105. <if test="releaseStart != null">
  106. release_start,
  107. </if>
  108. <if test="releaseEnd != null">
  109. release_end,
  110. </if>
  111. <if test="remarks != null">
  112. remarks,
  113. </if>
  114. <if test="annexUrl != null">
  115. annex_url,
  116. </if>
  117. <if test="userName != null">
  118. user_name,
  119. </if>
  120. <if test="longitude != null">
  121. longitude,
  122. </if>
  123. <if test="latitude != null">
  124. latitude,
  125. </if>
  126. <if test="status != null">
  127. `status`,
  128. </if>
  129. <if test="createTime != null">
  130. create_time,
  131. </if>
  132. <if test="clockIn != null">
  133. clock_in,
  134. </if>
  135. <if test="clockInTime != null">
  136. clock_in_time,
  137. </if>
  138. <if test="photoUrl != null">
  139. photo_url,
  140. </if>
  141. <if test="pid != null">
  142. pid,
  143. </if>
  144. <if test="pname != null">
  145. pname,
  146. </if>
  147. <if test="ufid != null">
  148. ufid,
  149. </if>
  150. <if test="duration != null">
  151. duration,
  152. </if>
  153. <if test="validDate != null">
  154. valid_date,
  155. </if>
  156. <if test="newUser != null">
  157. new_user,
  158. </if>
  159. <if test="signSum != null">
  160. sign_sum,
  161. </if>
  162. <if test="mainStatus != null">
  163. main_status,
  164. </if>
  165. <if test="supplement != null">
  166. supplement,
  167. </if>
  168. <if test="auditInfo != null">
  169. audit_info,
  170. </if>
  171. <if test="plan != null">
  172. `plan`,
  173. </if>
  174. <if test="expectedEffect != null">
  175. expected_effect,
  176. </if>
  177. <if test="nextPlan != null">
  178. next_plan,
  179. </if>
  180. <if test="type != null">
  181. `type`,
  182. </if>
  183. <if test="orderNo != null">
  184. order_no,
  185. </if>
  186. <if test="updateTime != null">
  187. update_time,
  188. </if>
  189. <if test="updateStatus != null">
  190. update_status,
  191. </if>
  192. <if test="assist != null">
  193. assist,
  194. </if>
  195. <if test="assistAid != null">
  196. assist_aid,
  197. </if>
  198. <if test="assistAidName != null">
  199. assist_aid_name,
  200. </if>
  201. <if test="mainId != null">
  202. main_id,
  203. </if>
  204. <if test="mainName != null">
  205. main_name,
  206. </if>
  207. <if test="clockInRemarks != null">
  208. clock_in_remarks,
  209. </if>
  210. <if test="rejectName != null">
  211. reject_name,
  212. </if>
  213. <if test="assistantAid != null">
  214. assistant_aid,
  215. </if>
  216. <if test="assistantName != null">
  217. assistant_name,
  218. </if>
  219. </trim>
  220. <trim prefix="values (" suffix=")" suffixOverrides=",">
  221. <if test="id != null">
  222. #{id,jdbcType=INTEGER},
  223. </if>
  224. <if test="uid != null">
  225. #{uid,jdbcType=VARCHAR},
  226. </if>
  227. <if test="aid != null">
  228. #{aid,jdbcType=VARCHAR},
  229. </if>
  230. <if test="releaseStart != null">
  231. #{releaseStart,jdbcType=TIMESTAMP},
  232. </if>
  233. <if test="releaseEnd != null">
  234. #{releaseEnd,jdbcType=TIMESTAMP},
  235. </if>
  236. <if test="remarks != null">
  237. #{remarks,jdbcType=VARCHAR},
  238. </if>
  239. <if test="annexUrl != null">
  240. #{annexUrl,jdbcType=VARCHAR},
  241. </if>
  242. <if test="userName != null">
  243. #{userName,jdbcType=VARCHAR},
  244. </if>
  245. <if test="longitude != null">
  246. #{longitude,jdbcType=VARCHAR},
  247. </if>
  248. <if test="latitude != null">
  249. #{latitude,jdbcType=VARCHAR},
  250. </if>
  251. <if test="status != null">
  252. #{status,jdbcType=INTEGER},
  253. </if>
  254. <if test="createTime != null">
  255. #{createTime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="clockIn != null">
  258. #{clockIn,jdbcType=INTEGER},
  259. </if>
  260. <if test="clockInTime != null">
  261. #{clockInTime,jdbcType=TIMESTAMP},
  262. </if>
  263. <if test="photoUrl != null">
  264. #{photoUrl,jdbcType=VARCHAR},
  265. </if>
  266. <if test="pid != null">
  267. #{pid,jdbcType=VARCHAR},
  268. </if>
  269. <if test="pname != null">
  270. #{pname,jdbcType=VARCHAR},
  271. </if>
  272. <if test="ufid != null">
  273. #{ufid,jdbcType=VARCHAR},
  274. </if>
  275. <if test="duration != null">
  276. #{duration,jdbcType=DOUBLE},
  277. </if>
  278. <if test="validDate != null">
  279. #{validDate,jdbcType=VARCHAR},
  280. </if>
  281. <if test="newUser != null">
  282. #{newUser,jdbcType=INTEGER},
  283. </if>
  284. <if test="signSum != null">
  285. #{signSum,jdbcType=INTEGER},
  286. </if>
  287. <if test="mainStatus != null">
  288. #{mainStatus,jdbcType=INTEGER},
  289. </if>
  290. <if test="supplement != null">
  291. #{supplement,jdbcType=VARCHAR},
  292. </if>
  293. <if test="auditInfo != null">
  294. #{auditInfo,jdbcType=VARCHAR},
  295. </if>
  296. <if test="plan != null">
  297. #{plan,jdbcType=VARCHAR},
  298. </if>
  299. <if test="expectedEffect != null">
  300. #{expectedEffect,jdbcType=VARCHAR},
  301. </if>
  302. <if test="nextPlan != null">
  303. #{nextPlan,jdbcType=VARCHAR},
  304. </if>
  305. <if test="type != null">
  306. #{type,jdbcType=INTEGER},
  307. </if>
  308. <if test="orderNo != null">
  309. #{orderNo,jdbcType=VARCHAR},
  310. </if>
  311. <if test="updateTime != null">
  312. #{updateTime,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="updateStatus != null">
  315. #{updateStatus,jdbcType=INTEGER},
  316. </if>
  317. <if test="assist != null">
  318. #{assist,jdbcType=INTEGER},
  319. </if>
  320. <if test="assistAid != null">
  321. #{assistAid,jdbcType=VARCHAR},
  322. </if>
  323. <if test="assistAidName != null">
  324. #{assistAidName,jdbcType=VARCHAR},
  325. </if>
  326. <if test="mainId != null">
  327. #{mainId,jdbcType=INTEGER},
  328. </if>
  329. <if test="mainName != null">
  330. #{mainName,jdbcType=VARCHAR},
  331. </if>
  332. <if test="clockInRemarks != null">
  333. #{clockInRemarks,jdbcType=VARCHAR},
  334. </if>
  335. <if test="rejectName != null">
  336. #{rejectName,jdbcType=VARCHAR},
  337. </if>
  338. <if test="assistantAid != null">
  339. #{assistantAid,jdbcType=VARCHAR},
  340. </if>
  341. <if test="assistantName != null">
  342. #{assistantName,jdbcType=VARCHAR},
  343. </if>
  344. </trim>
  345. </insert>
  346. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
  347. update public_release
  348. <set>
  349. <if test="uid != null">
  350. `uid` = #{uid,jdbcType=VARCHAR},
  351. </if>
  352. <if test="aid != null">
  353. aid = #{aid,jdbcType=VARCHAR},
  354. </if>
  355. <if test="releaseStart != null">
  356. release_start = #{releaseStart,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="releaseEnd != null">
  359. release_end = #{releaseEnd,jdbcType=TIMESTAMP},
  360. </if>
  361. <if test="remarks != null">
  362. remarks = #{remarks,jdbcType=VARCHAR},
  363. </if>
  364. <if test="annexUrl != null">
  365. annex_url = #{annexUrl,jdbcType=VARCHAR},
  366. </if>
  367. <if test="userName != null">
  368. user_name = #{userName,jdbcType=VARCHAR},
  369. </if>
  370. <if test="longitude != null">
  371. longitude = #{longitude,jdbcType=VARCHAR},
  372. </if>
  373. <if test="latitude != null">
  374. latitude = #{latitude,jdbcType=VARCHAR},
  375. </if>
  376. <if test="status != null">
  377. `status` = #{status,jdbcType=INTEGER},
  378. </if>
  379. <if test="createTime != null">
  380. create_time = #{createTime,jdbcType=TIMESTAMP},
  381. </if>
  382. <if test="clockIn != null">
  383. clock_in = #{clockIn,jdbcType=INTEGER},
  384. </if>
  385. <if test="clockInTime != null">
  386. clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
  387. </if>
  388. <if test="photoUrl != null">
  389. photo_url = #{photoUrl,jdbcType=VARCHAR},
  390. </if>
  391. <if test="pid != null">
  392. pid = #{pid,jdbcType=VARCHAR},
  393. </if>
  394. <if test="pname != null">
  395. pname = #{pname,jdbcType=VARCHAR},
  396. </if>
  397. <if test="ufid != null">
  398. ufid = #{ufid,jdbcType=VARCHAR},
  399. </if>
  400. <if test="duration != null">
  401. duration = #{duration,jdbcType=DOUBLE},
  402. </if>
  403. <if test="validDate != null">
  404. valid_date = #{validDate,jdbcType=VARCHAR},
  405. </if>
  406. <if test="newUser != null">
  407. new_user = #{newUser,jdbcType=INTEGER},
  408. </if>
  409. <if test="signSum != null">
  410. sign_sum = #{signSum,jdbcType=INTEGER},
  411. </if>
  412. <if test="mainStatus != null">
  413. main_status = #{mainStatus,jdbcType=INTEGER},
  414. </if>
  415. <if test="supplement != null">
  416. supplement = #{supplement,jdbcType=VARCHAR},
  417. </if>
  418. <if test="auditInfo != null">
  419. audit_info = #{auditInfo,jdbcType=VARCHAR},
  420. </if>
  421. <if test="plan != null">
  422. `plan` = #{plan,jdbcType=VARCHAR},
  423. </if>
  424. <if test="expectedEffect != null">
  425. expected_effect = #{expectedEffect,jdbcType=VARCHAR},
  426. </if>
  427. <if test="nextPlan != null">
  428. next_plan = #{nextPlan,jdbcType=VARCHAR},
  429. </if>
  430. <if test="type != null">
  431. `type` = #{type,jdbcType=INTEGER},
  432. </if>
  433. <if test="orderNo != null">
  434. order_no = #{orderNo,jdbcType=VARCHAR},
  435. </if>
  436. <if test="updateTime != null">
  437. update_time = #{updateTime,jdbcType=TIMESTAMP},
  438. </if>
  439. <if test="updateStatus != null">
  440. update_status = #{updateStatus,jdbcType=INTEGER},
  441. </if>
  442. <if test="assist != null">
  443. assist = #{assist,jdbcType=INTEGER},
  444. </if>
  445. <if test="assistAid != null">
  446. assist_aid = #{assistAid,jdbcType=VARCHAR},
  447. </if>
  448. <if test="assistAidName != null">
  449. assist_aid_name = #{assistAidName,jdbcType=VARCHAR},
  450. </if>
  451. <if test="mainId != null">
  452. main_id = #{mainId,jdbcType=INTEGER},
  453. </if>
  454. <if test="mainName != null">
  455. main_name = #{mainName,jdbcType=VARCHAR},
  456. </if>
  457. <if test="clockInRemarks != null">
  458. clock_in_remarks = #{clockInRemarks,jdbcType=VARCHAR},
  459. </if>
  460. <if test="rejectName != null">
  461. reject_name = #{rejectName,jdbcType=VARCHAR},
  462. </if>
  463. <if test="assistantAid != null">
  464. assistant_aid = #{assistantAid,jdbcType=VARCHAR},
  465. </if>
  466. <if test="assistantName != null">
  467. assistant_name = #{assistantName,jdbcType=VARCHAR},
  468. </if>
  469. </set>
  470. where id = #{id,jdbcType=INTEGER}
  471. </update>
  472. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicRelease">
  473. update public_release
  474. set `uid` = #{uid,jdbcType=VARCHAR},
  475. aid = #{aid,jdbcType=VARCHAR},
  476. release_start = #{releaseStart,jdbcType=TIMESTAMP},
  477. release_end = #{releaseEnd,jdbcType=TIMESTAMP},
  478. remarks = #{remarks,jdbcType=VARCHAR},
  479. annex_url = #{annexUrl,jdbcType=VARCHAR},
  480. user_name = #{userName,jdbcType=VARCHAR},
  481. longitude = #{longitude,jdbcType=VARCHAR},
  482. latitude = #{latitude,jdbcType=VARCHAR},
  483. `status` = #{status,jdbcType=INTEGER},
  484. create_time = #{createTime,jdbcType=TIMESTAMP},
  485. clock_in = #{clockIn,jdbcType=INTEGER},
  486. clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
  487. photo_url = #{photoUrl,jdbcType=VARCHAR},
  488. pid = #{pid,jdbcType=VARCHAR},
  489. pname = #{pname,jdbcType=VARCHAR},
  490. ufid = #{ufid,jdbcType=VARCHAR},
  491. duration = #{duration,jdbcType=DOUBLE},
  492. valid_date = #{validDate,jdbcType=VARCHAR},
  493. new_user = #{newUser,jdbcType=INTEGER},
  494. sign_sum = #{signSum,jdbcType=INTEGER},
  495. main_status = #{mainStatus,jdbcType=INTEGER},
  496. supplement = #{supplement,jdbcType=VARCHAR},
  497. audit_info = #{auditInfo,jdbcType=VARCHAR},
  498. `plan` = #{plan,jdbcType=VARCHAR},
  499. expected_effect = #{expectedEffect,jdbcType=VARCHAR},
  500. next_plan = #{nextPlan,jdbcType=VARCHAR},
  501. `type` = #{type,jdbcType=INTEGER},
  502. order_no = #{orderNo,jdbcType=VARCHAR},
  503. update_time = #{updateTime,jdbcType=TIMESTAMP},
  504. update_status = #{updateStatus,jdbcType=INTEGER},
  505. assist = #{assist,jdbcType=INTEGER},
  506. assist_aid = #{assistAid,jdbcType=VARCHAR},
  507. assist_aid_name = #{assistAidName,jdbcType=VARCHAR},
  508. main_id = #{mainId,jdbcType=INTEGER},
  509. main_name = #{mainName,jdbcType=VARCHAR},
  510. clock_in_remarks = #{clockInRemarks,jdbcType=VARCHAR},
  511. reject_name = #{rejectName,jdbcType=VARCHAR},
  512. assistant_aid = #{assistantAid,jdbcType=VARCHAR},
  513. assistant_name = #{assistantName,jdbcType=VARCHAR}
  514. where id = #{id,jdbcType=INTEGER}
  515. </update>
  516. <update id="updateSignByAidAndUid">
  517. update public_release a ,(select max(create_time)create_time from public_release
  518. where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
  519. set a.sign_sum =a.sign_sum +1
  520. where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
  521. </update>
  522. <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
  523. select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,a.aid,
  524. 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,
  525. a.latitude ,a.longitude ,a.clock_in clockIn,date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,
  526. a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
  527. a.assistant_aid assistantAid ,a.assistant_name assistantName
  528. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  529. <if test="type==2">
  530. left join department d on c.department_id =d.id
  531. </if>
  532. where 1=1
  533. <if test="type==0">
  534. <if test="assist == 2">
  535. and a.assist =2
  536. </if>
  537. <if test="assist == 3">
  538. and a.assist =3
  539. </if>
  540. <if test="assist ==4">
  541. and a.assist in (2,3)
  542. </if>
  543. <if test="assist !=2 and assist !=3 and assist !=4 and assistType !=1">
  544. and a.assist in(0,1)
  545. </if>
  546. <if test="aid !=null">
  547. and a.aid= #{aid}
  548. </if>
  549. </if>
  550. <if test="type==1">
  551. and a.assist in(0,1)
  552. and c.reviewer = #{aid}
  553. </if>
  554. <if test="type==2">
  555. and a.assist in(0,1)
  556. and d.manager_id = #{aid}
  557. </if>
  558. <if test="type==3">
  559. and a.assist in (2,3)
  560. <if test="aid !=null">
  561. and a.aid= #{aid}
  562. </if>
  563. and a.type = #{type}
  564. </if>
  565. <if test="clockTime !=null">
  566. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  567. </if>
  568. <if test="releaseStarts != null and publicEnd != null">
  569. and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
  570. </if>
  571. <if test="userName !=null">
  572. and b.nickname like CONCAT('%',#{userName},'%')
  573. </if>
  574. <if test="status !=null">
  575. and a.status = #{status}
  576. </if>
  577. <if test="clockIn !=null">
  578. and a.clock_in = #{clockIn}
  579. </if>
  580. <if test="type==2">
  581. ORDER BY a.create_time desc
  582. </if>
  583. <if test="type!=2">
  584. ORDER BY (case when a.status=1 then 1 when a.status=2 then 2 when a.status=3 then 5
  585. when a.status=0 then 3 when a.status=4 then 4
  586. else 0 end),a.status ,a.create_time desc
  587. </if>
  588. <if test="page_sql!=null">
  589. ${page_sql}
  590. </if>
  591. </select>
  592. <select id="countPublicRelease" resultType="java.lang.Integer">
  593. select count(*)
  594. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  595. <if test="type==2">
  596. left join department d on c.department_id =d.id
  597. </if>
  598. where 1=1
  599. <if test="type==0">
  600. <if test="assist == 2">
  601. and a.assist =2
  602. </if>
  603. <if test="assist == 3">
  604. and a.assist =3
  605. </if>
  606. <if test="assist ==4">
  607. and a.assist in (2,3)
  608. </if>
  609. <if test="assist !=2 and assist !=3 and assist !=4 and assistType !=1">
  610. and a.assist in(0,1)
  611. </if>
  612. <if test="assistType ==1">
  613. and a.assist in(0,1,2)
  614. </if>
  615. <if test="aid !=null">
  616. and a.aid= #{aid}
  617. </if>
  618. </if>
  619. <if test="type==1">
  620. and a.assist in(0,1)
  621. and c.reviewer = #{aid}
  622. </if>
  623. <if test="type==2">
  624. and a.assist in(0,1)
  625. and d.manager_id = #{aid}
  626. </if>
  627. <if test="type==3">
  628. and a.assist=2
  629. <if test="aid !=null">
  630. and a.aid= #{aid}
  631. </if>
  632. and a.type = #{type}
  633. </if>
  634. <if test="clockTime !=null">
  635. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  636. </if>
  637. <if test="releaseStarts != null and publicEnd != null">
  638. and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
  639. </if>
  640. <if test="userName !=null">
  641. and b.nickname like CONCAT('%',#{userName},'%')
  642. </if>
  643. <if test="status !=null">
  644. and a.status = #{status}
  645. </if>
  646. <if test="clockIn !=null">
  647. and a.clock_in = #{clockIn}
  648. </if>
  649. </select>
  650. <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
  651. select a.id,b.nickname ,c.name aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,a.update_time updateTime,
  652. 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,
  653. a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid,
  654. a.clock_in clockIn ,a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,
  655. date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_Status updateStatus,a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,
  656. a.main_name mainName,a.assistant_aid assistantAid,a.assistant_name assistantName
  657. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  658. left join t_order_new d on a.order_no=d.order_no
  659. where 1=1
  660. <if test="id !=null">
  661. and a.id= #{id}
  662. </if>
  663. <if test="ufid !=null">
  664. and a.ufid= #{ufid}
  665. </if>
  666. </select>
  667. <select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
  668. select y.aid,y.bh,y.dk,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.dk)dk,sum(x.duration)duration
  669. from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
  670. ,if(a.status=2,a.duration,0)duration from public_release a left join admin b on a.aid=b.id
  671. where 1=1
  672. <if test="aid != null">
  673. and a.aid= #{aid}
  674. </if>
  675. <if test="clockStart != null and clockEnd != null">
  676. and a.clock_in_time between #{clockStart} and #{clockEnd}
  677. </if>
  678. <if test="createStart != null and createEnd !=null">
  679. and a.create_time between #{createStart} and #{createEnd}
  680. </if>
  681. <if test="depId != null">
  682. and b.department_id = #{depId}
  683. </if>
  684. )x group by x.aid)y left join admin c on c.id=y.aid
  685. <if test="page_sql!=null">
  686. ${page_sql}
  687. </if>
  688. </select>
  689. <select id="countPublicStatistics" resultType="java.lang.Integer">
  690. select count(*) from (select aid from public_release a left join admin b on a.aid=b.id
  691. where 1=1
  692. <if test="aid != null">
  693. and a.aid= #{aid}
  694. </if>
  695. <if test="clockStart != null and clockEnd != null">
  696. and a.clock_in_time between #{clockStart} and #{clockEnd}
  697. </if>
  698. <if test="createStart != null and createEnd !=null">
  699. and a.create_time between #{createStart} and #{createEnd}
  700. </if>
  701. <if test="depId != null">
  702. and b.department_id = #{depId}
  703. </if>
  704. group by aid)x
  705. </select>
  706. <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
  707. select a.id,b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
  708. date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
  709. date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,d.name sname,
  710. date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
  711. a.plan ,a.next_plan nextPlan ,a.expected_effect expectedEffect,a.update_status updateStatus,a.assist_aid_name assistAidName,
  712. a.main_name mainName,a.assist,a.assistant_aid assistantAid, a.assistant_name assistantName
  713. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  714. left join admin d on b.aid=d.id where 1=1
  715. <if test="publicType != null">
  716. and a.type= #{publicType}
  717. </if>
  718. <if test="aid != null">
  719. and a.aid= #{aid}
  720. </if>
  721. <if test="sid != null">
  722. and d.id= #{sid}
  723. </if>
  724. <if test="depId != null">
  725. and c.department_id = #{depId}
  726. </if>
  727. <if test="type==1 and deps !=null">
  728. and c.department_id in
  729. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  730. #{deps.id}
  731. </foreach>
  732. </if>
  733. <if test="uid != null">
  734. and a.uid = #{uid}
  735. </if>
  736. <if test="releaseStart != null and releaseEnd != null">
  737. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  738. </if>
  739. <if test="createStart != null and createEnd != null">
  740. and a.create_time between #{createStart} and #{createEnd}
  741. </if>
  742. <if test="status != null">
  743. and a.status = #{status}
  744. </if>
  745. <if test="clockIn !=null">
  746. and a.clock_in= #{clockIn}
  747. </if>
  748. order by a.status,a.create_time desc
  749. <if test="page_sql!=null">
  750. ${page_sql}
  751. </if>
  752. </select>
  753. <select id="countPublicDtails" resultType="java.lang.Integer">
  754. select count(*)
  755. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  756. left join admin d on b.aid=d.id
  757. where 1=1
  758. <if test="publicType != null">
  759. and a.type= #{publicType}
  760. </if>
  761. <if test="aid != null">
  762. and a.aid= #{aid}
  763. </if>
  764. <if test="sid != null">
  765. and d.id= #{sid}
  766. </if>
  767. <if test="depId != null">
  768. and c.department_id = #{depId}
  769. </if>
  770. <if test="type==1 and deps !=null">
  771. and c.department_id in
  772. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  773. #{deps.id}
  774. </foreach>
  775. </if>
  776. <if test="uid != null">
  777. and a.uid = #{uid}
  778. </if>
  779. <if test="releaseStart != null and releaseEnd != null">
  780. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  781. </if>
  782. <if test="createStart != null and createEnd != null">
  783. and a.create_time between #{createStart} and #{createEnd}
  784. </if>
  785. <if test="status != null">
  786. and a.status = #{status}
  787. </if>
  788. <if test="clockIn !=null">
  789. and a.clock_in= #{clockIn}
  790. </if>
  791. </select>
  792. <select id="checkTime" resultType="java.lang.Integer">
  793. select id from public_release where aid=#{aid} and status in (0,1,2)
  794. and ( (release_start &gt;= #{start} and release_start &lt; #{end})
  795. or (release_start &lt; #{start} and release_end &gt; #{start})
  796. or (release_start &lt; #{end} and release_end &gt; #{end}))
  797. </select>
  798. <select id="getTimeUserFollow" resultType="com.goafanti.common.model.OutPublicReleaseCount">
  799. select e.id province,d.id depId,a.aid,a.uid,a.new_user newUser ,1 quantity from (select aid,uid,new_user from public_release
  800. where main_status =1 and create_time between #{date} and #{now}
  801. group by aid,uid,new_user)a left join admin c on a.aid=c.id
  802. left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
  803. </select>
  804. <select id="publicByOrder" resultType="com.goafanti.weChat.bo.OutPublicRelease">
  805. select a.id,a.uid,a.aid,b.nickname ,c.name aname,a.duration ,a.user_name userName,
  806. date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStarts,
  807. date_format(a.release_end ,'%Y-%m-%d %H:%i:%S')releaseEnds,
  808. date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S')clockInTimes,
  809. a.remarks
  810. from public_release a left join user b on a.uid=b.id
  811. left join admin c on a.aid =c.id
  812. where a.order_no = #{orderNo}
  813. </select>
  814. <select id="selectByMainId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  815. select
  816. <include refid="Base_Column_List" />
  817. from public_release
  818. where main_id = #{mainId}
  819. <if test="type !=null">
  820. and type= #{type}
  821. </if>
  822. <if test="aid !=null">
  823. and aid= #{aid}
  824. </if>
  825. </select>
  826. <update id="updateStatusByMainId">
  827. update public_release set status= #{status}
  828. where main_id= #{mainId}
  829. <if test="type !=null">
  830. and type= #{type}
  831. </if>
  832. <if test="aid !=null">
  833. and aid= #{aid}
  834. </if>
  835. </update>
  836. </mapper>