PublicReleaseMapper.xml 32 KB

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