PublicReleaseMapper.xml 32 KB

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