PublicReleaseMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  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. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  528. <if test="type==2">
  529. left join department d on c.department_id =d.id
  530. </if>
  531. where 1=1
  532. <if test="type==0">
  533. <if test="assist == 2">
  534. and a.assist =2
  535. </if>
  536. <if test="assist !=2 and assistType !=1">
  537. and a.assist in(0,1)
  538. </if>
  539. <if test="assistType ==1">
  540. and a.assist in(0,1,2)
  541. </if>
  542. <if test="aid !=null">
  543. and a.aid= #{aid}
  544. </if>
  545. </if>
  546. <if test="type==1">
  547. and a.assist in(0,1)
  548. and c.reviewer = #{aid}
  549. </if>
  550. <if test="type==2">
  551. and a.assist in(0,1)
  552. and d.manager_id = #{aid}
  553. </if>
  554. <if test="type==3">
  555. and a.assist=2
  556. <if test="aid !=null">
  557. and a.aid= #{aid}
  558. </if>
  559. and a.type = #{type}
  560. </if>
  561. <if test="clockTime !=null">
  562. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  563. </if>
  564. <if test="releaseStarts != null and publicEnd != null">
  565. and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
  566. </if>
  567. <if test="userName !=null">
  568. and b.nickname like CONCAT('%',#{userName},'%')
  569. </if>
  570. <if test="status !=null">
  571. and a.status = #{status}
  572. </if>
  573. <if test="clockIn !=null">
  574. and a.clock_in = #{clockIn}
  575. </if>
  576. <if test="type==2">
  577. ORDER BY a.create_time desc
  578. </if>
  579. <if test="type!=2">
  580. ORDER BY (case when a.status=1 then 1 when a.status=2 then 2 when a.status=3 then 5
  581. when a.status=0 then 3 when a.status=4 then 4
  582. else 0 end),a.status ,a.create_time desc
  583. </if>
  584. <if test="page_sql!=null">
  585. ${page_sql}
  586. </if>
  587. </select>
  588. <select id="countPublicRelease" resultType="java.lang.Integer">
  589. select count(*)
  590. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  591. <if test="type==2">
  592. left join department d on c.department_id =d.id
  593. </if>
  594. where 1=1
  595. <if test="type==0">
  596. <if test="assist == 2">
  597. and a.assist =2
  598. </if>
  599. <if test="assist !=2 and assistType !=1">
  600. and a.assist in(0,1)
  601. </if>
  602. <if test="assistType ==1">
  603. and a.assist in(0,1,2)
  604. </if>
  605. <if test="aid !=null">
  606. and a.aid= #{aid}
  607. </if>
  608. </if>
  609. <if test="type==1">
  610. and a.assist in(0,1)
  611. and c.reviewer = #{aid}
  612. </if>
  613. <if test="type==2">
  614. and a.assist in(0,1)
  615. and d.manager_id = #{aid}
  616. </if>
  617. <if test="type==3">
  618. and a.assist=2
  619. <if test="aid !=null">
  620. and a.aid= #{aid}
  621. </if>
  622. and a.type = #{type}
  623. </if>
  624. <if test="clockTime !=null">
  625. and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
  626. </if>
  627. <if test="releaseStarts != null and publicEnd != null">
  628. and a.release_start BETWEEN #{releaseStarts} and #{publicEnd}
  629. </if>
  630. <if test="userName !=null">
  631. and b.nickname like CONCAT('%',#{userName},'%')
  632. </if>
  633. <if test="status !=null">
  634. and a.status = #{status}
  635. </if>
  636. <if test="clockIn !=null">
  637. and a.clock_in = #{clockIn}
  638. </if>
  639. </select>
  640. <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
  641. 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,
  642. 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,
  643. a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid,
  644. 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,
  645. 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,
  646. a.main_name mainName
  647. from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
  648. left join t_order_new d on a.order_no=d.order_no
  649. where 1=1
  650. <if test="id !=null">
  651. and a.id= #{id}
  652. </if>
  653. <if test="ufid !=null">
  654. and a.ufid= #{ufid}
  655. </if>
  656. </select>
  657. <select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
  658. 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
  659. 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
  660. ,if(a.status=2,a.duration,0)duration from public_release a left join admin b on a.aid=b.id
  661. where 1=1
  662. <if test="aid != null">
  663. and a.aid= #{aid}
  664. </if>
  665. <if test="clockStart != null and clockEnd != null">
  666. and a.clock_in_time between #{clockStart} and #{clockEnd}
  667. </if>
  668. <if test="createStart != null and createEnd !=null">
  669. and a.create_time between #{createStart} and #{createEnd}
  670. </if>
  671. <if test="depId != null">
  672. and b.department_id = #{depId}
  673. </if>
  674. )x group by x.aid)y left join admin c on c.id=y.aid
  675. <if test="page_sql!=null">
  676. ${page_sql}
  677. </if>
  678. </select>
  679. <select id="countPublicStatistics" resultType="java.lang.Integer">
  680. select count(*) from (select aid from public_release a left join admin b on a.aid=b.id
  681. where 1=1
  682. <if test="aid != null">
  683. and a.aid= #{aid}
  684. </if>
  685. <if test="clockStart != null and clockEnd != null">
  686. and a.clock_in_time between #{clockStart} and #{clockEnd}
  687. </if>
  688. <if test="createStart != null and createEnd !=null">
  689. and a.create_time between #{createStart} and #{createEnd}
  690. </if>
  691. <if test="depId != null">
  692. and b.department_id = #{depId}
  693. </if>
  694. group by aid)x
  695. </select>
  696. <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
  697. select a.id,b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
  698. date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
  699. date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,d.name sname,
  700. date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
  701. a.plan ,a.next_plan nextPlan ,a.expected_effect expectedEffect,a.update_status updateStatus,a.assist_aid_name assistAidName,
  702. a.main_name mainName,a.assist
  703. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  704. left join admin d on b.aid=d.id where 1=1
  705. <if test="publicType != null">
  706. and a.type= #{publicType}
  707. </if>
  708. <if test="aid != null">
  709. and a.aid= #{aid}
  710. </if>
  711. <if test="sid != null">
  712. and d.id= #{sid}
  713. </if>
  714. <if test="depId != null">
  715. and c.department_id = #{depId}
  716. </if>
  717. <if test="type==1 and deps !=null">
  718. and c.department_id in
  719. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  720. #{deps.id}
  721. </foreach>
  722. </if>
  723. <if test="uid != null">
  724. and a.uid = #{uid}
  725. </if>
  726. <if test="releaseStart != null and releaseEnd != null">
  727. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  728. </if>
  729. <if test="createStart != null and createEnd != null">
  730. and a.create_time between #{createStart} and #{createEnd}
  731. </if>
  732. <if test="status != null">
  733. and a.status = #{status}
  734. </if>
  735. <if test="clockIn !=null">
  736. and a.clock_in= #{clockIn}
  737. </if>
  738. order by a.status,a.create_time desc
  739. <if test="page_sql!=null">
  740. ${page_sql}
  741. </if>
  742. </select>
  743. <select id="countPublicDtails" resultType="java.lang.Integer">
  744. select count(*)
  745. from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
  746. left join admin d on b.aid=d.id
  747. where 1=1
  748. <if test="publicType != null">
  749. and a.type= #{publicType}
  750. </if>
  751. <if test="aid != null">
  752. and a.aid= #{aid}
  753. </if>
  754. <if test="sid != null">
  755. and d.id= #{sid}
  756. </if>
  757. <if test="depId != null">
  758. and c.department_id = #{depId}
  759. </if>
  760. <if test="type==1 and deps !=null">
  761. and c.department_id in
  762. <foreach close=")" collection="deps" item="deps" open="(" separator=",">
  763. #{deps.id}
  764. </foreach>
  765. </if>
  766. <if test="uid != null">
  767. and a.uid = #{uid}
  768. </if>
  769. <if test="releaseStart != null and releaseEnd != null">
  770. and (a.release_start between #{releaseStart} and #{releaseEnd} or a.release_end between #{releaseStart} and #{releaseEnd})
  771. </if>
  772. <if test="createStart != null and createEnd != null">
  773. and a.create_time between #{createStart} and #{createEnd}
  774. </if>
  775. <if test="status != null">
  776. and a.status = #{status}
  777. </if>
  778. <if test="clockIn !=null">
  779. and a.clock_in= #{clockIn}
  780. </if>
  781. </select>
  782. <select id="checkTime" resultType="java.lang.Integer">
  783. select id from public_release where aid=#{aid} and status in (0,1,2)
  784. and ( (release_start &gt;= #{start} and release_start &lt; #{end})
  785. or (release_start &lt; #{start} and release_end &gt; #{start})
  786. or (release_start &lt; #{end} and release_end &gt; #{end}))
  787. </select>
  788. <select id="getTimeUserFollow" resultType="com.goafanti.common.model.OutPublicReleaseCount">
  789. 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
  790. where main_status =1 and create_time between #{date} and #{now}
  791. group by aid,uid,new_user)a left join admin c on a.aid=c.id
  792. left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
  793. </select>
  794. <select id="publicByOrder" resultType="com.goafanti.weChat.bo.OutPublicRelease">
  795. select a.id,a.uid,a.aid,b.nickname ,c.name aname,a.duration ,a.user_name userName,
  796. date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStarts,
  797. date_format(a.release_end ,'%Y-%m-%d %H:%i:%S')releaseEnds,
  798. date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S')clockInTimes,
  799. a.remarks
  800. from public_release a left join user b on a.uid=b.id
  801. left join admin c on a.aid =c.id
  802. where a.order_no = #{orderNo}
  803. </select>
  804. <select id="selectByMainId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  805. select
  806. <include refid="Base_Column_List" />
  807. from public_release
  808. where main_id = #{mainId}
  809. <if test="type !=null">
  810. and type= #{type}
  811. </if>
  812. <if test="aid !=null">
  813. and type= #{aid}
  814. </if>
  815. </select>
  816. <update id="updateStatusByMainId">
  817. update public_release set status= #{status}
  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. </update>
  826. </mapper>