DilNoticeMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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.steerinfo.dil.mapper.DilNoticeMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilNotice">
  5. <id column="NOTICE_ID" jdbcType="DECIMAL" property="noticeId" />
  6. <result column="NOTICE_TITLE" jdbcType="VARCHAR" property="noticeTitle" />
  7. <result column="NOTICE_CONTENT" jdbcType="VARCHAR" property="noticeContent" />
  8. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  9. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  10. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  11. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  12. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  13. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  14. <result column="PERMISSION" jdbcType="DECIMAL" property="permission" />
  15. </resultMap>
  16. <sql id="columns">
  17. NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  18. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PERMISSION
  19. </sql>
  20. <sql id="columns_alias">
  21. t.NOTICE_ID, t.NOTICE_TITLE, t.NOTICE_CONTENT, t.INSERT_USERNAME, t.INSERT_TIME,
  22. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PERMISSION
  23. </sql>
  24. <sql id="select">
  25. SELECT <include refid="columns"/> FROM DIL_NOTICE
  26. </sql>
  27. <sql id="select_alias">
  28. SELECT <include refid="columns_alias"/> FROM DIL_NOTICE t
  29. </sql>
  30. <sql id="where">
  31. <where>
  32. <if test="noticeId != null">
  33. and NOTICE_ID = #{noticeId}
  34. </if>
  35. <if test="noticeTitle != null and noticeTitle != ''">
  36. and NOTICE_TITLE = #{noticeTitle}
  37. </if>
  38. <if test="noticeContent != null and noticeContent != ''">
  39. and NOTICE_CONTENT = #{noticeContent}
  40. </if>
  41. <if test="insertUsername != null and insertUsername != ''">
  42. and INSERT_USERNAME = #{insertUsername}
  43. </if>
  44. <if test="insertTime != null">
  45. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  46. </if>
  47. <if test="updateUsername != null and updateUsername != ''">
  48. and UPDATE_USERNAME = #{updateUsername}
  49. </if>
  50. <if test="updateTime != null">
  51. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  52. </if>
  53. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  54. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  55. </if>
  56. <if test="deleted != null">
  57. and DELETED = #{deleted}
  58. </if>
  59. <if test="permission != null">
  60. and PERMISSION = #{permission}
  61. </if>
  62. </where>
  63. </sql>
  64. <sql id="whereLike">
  65. <where>
  66. <if test="noticeId != null">
  67. and NOTICE_ID = #{noticeId}
  68. </if>
  69. <if test="noticeTitle != null and noticeTitle != ''">
  70. and NOTICE_TITLE LIKE '%${noticeTitle}%'
  71. </if>
  72. <if test="noticeContent != null and noticeContent != ''">
  73. and NOTICE_CONTENT LIKE '%${noticeContent}%'
  74. </if>
  75. <if test="insertUsername != null and insertUsername != ''">
  76. and INSERT_USERNAME LIKE '%${insertUsername}%'
  77. </if>
  78. <if test="insertTime != null">
  79. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  80. </if>
  81. <if test="updateUsername != null and updateUsername != ''">
  82. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  83. </if>
  84. <if test="updateTime != null">
  85. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  86. </if>
  87. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  88. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  89. </if>
  90. <if test="deleted != null">
  91. and DELETED = #{deleted}
  92. </if>
  93. <if test="permission != null">
  94. and PERMISSION = #{permission}
  95. </if>
  96. </where>
  97. </sql>
  98. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  99. delete from DIL_NOTICE
  100. where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
  101. </delete>
  102. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  103. delete from DIL_NOTICE
  104. where 1!=1
  105. <if test="noticeTitle != null and noticeTitle != ''">
  106. or NOTICE_TITLE = #{noticeTitle}
  107. </if>
  108. <if test="noticeContent != null and noticeContent != ''">
  109. or NOTICE_CONTENT = #{noticeContent}
  110. </if>
  111. <if test="insertUsername != null and insertUsername != ''">
  112. or INSERT_USERNAME = #{insertUsername}
  113. </if>
  114. <if test="insertTime != null">
  115. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  116. </if>
  117. <if test="updateUsername != null and updateUsername != ''">
  118. or UPDATE_USERNAME = #{updateUsername}
  119. </if>
  120. <if test="updateTime != null">
  121. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  122. </if>
  123. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  124. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  125. </if>
  126. <if test="deleted != null">
  127. or DELETED = #{deleted}
  128. </if>
  129. <if test="permission != null">
  130. or PERMISSION = #{permission}
  131. </if>
  132. </delete>
  133. <insert id="insert" parameterType="com.steerinfo.dil.model.DilNotice">
  134. insert into DIL_NOTICE (NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT,
  135. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  136. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  137. PERMISSION)
  138. values (#{noticeId,jdbcType=DECIMAL}, #{noticeTitle,jdbcType=VARCHAR}, #{noticeContent,jdbcType=VARCHAR},
  139. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  140. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  141. #{permission,jdbcType=DECIMAL})
  142. </insert>
  143. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilNotice">
  144. insert into DIL_NOTICE
  145. <trim prefix="(" suffix=")" suffixOverrides=",">
  146. <if test="noticeId != null">
  147. NOTICE_ID,
  148. </if>
  149. <if test="noticeTitle != null">
  150. NOTICE_TITLE,
  151. </if>
  152. <if test="noticeContent != null">
  153. NOTICE_CONTENT,
  154. </if>
  155. <if test="insertUsername != null">
  156. INSERT_USERNAME,
  157. </if>
  158. <if test="insertTime != null">
  159. INSERT_TIME,
  160. </if>
  161. <if test="updateUsername != null">
  162. UPDATE_USERNAME,
  163. </if>
  164. <if test="updateTime != null">
  165. UPDATE_TIME,
  166. </if>
  167. <if test="insertUpdateRemark != null">
  168. INSERT_UPDATE_REMARK,
  169. </if>
  170. <if test="deleted != null">
  171. DELETED,
  172. </if>
  173. <if test="permission != null">
  174. PERMISSION,
  175. </if>
  176. </trim>
  177. <trim prefix="values (" suffix=")" suffixOverrides=",">
  178. <if test="noticeId != null">
  179. #{noticeId,jdbcType=DECIMAL},
  180. </if>
  181. <if test="noticeTitle != null">
  182. #{noticeTitle,jdbcType=VARCHAR},
  183. </if>
  184. <if test="noticeContent != null">
  185. #{noticeContent,jdbcType=VARCHAR},
  186. </if>
  187. <if test="insertUsername != null">
  188. #{insertUsername,jdbcType=VARCHAR},
  189. </if>
  190. <if test="insertTime != null">
  191. #{insertTime,jdbcType=TIMESTAMP},
  192. </if>
  193. <if test="updateUsername != null">
  194. #{updateUsername,jdbcType=VARCHAR},
  195. </if>
  196. <if test="updateTime != null">
  197. #{updateTime,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="insertUpdateRemark != null">
  200. #{insertUpdateRemark,jdbcType=VARCHAR},
  201. </if>
  202. <if test="deleted != null">
  203. #{deleted,jdbcType=DECIMAL},
  204. </if>
  205. <if test="permission != null">
  206. #{permission,jdbcType=DECIMAL},
  207. </if>
  208. </trim>
  209. </insert>
  210. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilNotice">
  211. update DIL_NOTICE
  212. set NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
  213. NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
  214. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  215. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  216. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  217. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  218. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  219. DELETED = #{deleted,jdbcType=DECIMAL},
  220. PERMISSION = #{permission,jdbcType=DECIMAL}
  221. where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
  222. </update>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilNotice">
  224. update DIL_NOTICE
  225. <set>
  226. <if test="noticeTitle != null">
  227. NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
  228. </if>
  229. <if test="noticeContent != null">
  230. NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
  231. </if>
  232. <if test="insertUsername != null">
  233. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  234. </if>
  235. <if test="insertTime != null">
  236. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  237. </if>
  238. <if test="updateUsername != null">
  239. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  240. </if>
  241. <if test="updateTime != null">
  242. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  243. </if>
  244. <if test="insertUpdateRemark != null">
  245. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  246. </if>
  247. <if test="deleted != null">
  248. DELETED = #{deleted,jdbcType=DECIMAL},
  249. </if>
  250. <if test="permission != null">
  251. PERMISSION = #{permission,jdbcType=DECIMAL},
  252. </if>
  253. </set>
  254. where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
  255. </update>
  256. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  257. <include refid="select"/>
  258. where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
  259. </select>
  260. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  261. <include refid="select"/>
  262. <include refid="where"/>
  263. </select>
  264. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  265. <include refid="select"/>
  266. <include refid="whereLike"/>
  267. </select>
  268. <insert id="batchInsert" parameterType="java.util.List">
  269. insert into DIL_NOTICE
  270. (NOTICE_ID,
  271. NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME,
  272. INSERT_TIME, UPDATE_USERNAME,
  273. UPDATE_TIME, INSERT_UPDATE_REMARK,
  274. DELETED, PERMISSION)
  275. ( <foreach collection="list" item="item" separator="union all">
  276. select
  277. #{item.noticeId,jdbcType=DECIMAL},
  278. #{item.noticeTitle,jdbcType=VARCHAR}, #{item.noticeContent,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  279. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  280. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  281. #{item.deleted,jdbcType=DECIMAL}, #{item.permission,jdbcType=DECIMAL} from dual
  282. </foreach> )
  283. </insert>
  284. <update id="batchUpdate" parameterType="java.util.List">
  285. update DIL_NOTICE
  286. set
  287. NOTICE_ID=
  288. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  289. when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeId,jdbcType=DECIMAL}
  290. </foreach>
  291. ,NOTICE_TITLE=
  292. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  293. when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeTitle,jdbcType=VARCHAR}
  294. </foreach>
  295. ,NOTICE_CONTENT=
  296. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  297. when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeContent,jdbcType=VARCHAR}
  298. </foreach>
  299. ,INSERT_USERNAME=
  300. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  301. when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  302. </foreach>
  303. ,INSERT_TIME=
  304. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  305. when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  306. </foreach>
  307. ,UPDATE_USERNAME=
  308. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  309. when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  310. </foreach>
  311. ,UPDATE_TIME=
  312. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  313. when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  314. </foreach>
  315. ,INSERT_UPDATE_REMARK=
  316. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  317. when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  318. </foreach>
  319. ,DELETED=
  320. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  321. when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  322. </foreach>
  323. ,PERMISSION=
  324. <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
  325. when #{item.noticeId,jdbcType=DECIMAL} then #{item.permission,jdbcType=DECIMAL}
  326. </foreach>
  327. where NOTICE_ID in
  328. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  329. #{item.noticeId,jdbcType=DECIMAL}
  330. </foreach>
  331. </update>
  332. <delete id="batchDelete" parameterType="java.util.List">
  333. delete from DIL_NOTICE
  334. where NOTICE_ID in
  335. <foreach collection="list" item="id" open="(" close=")" separator=",">
  336. #{id}
  337. </foreach>
  338. </delete>
  339. <!-- 友情提示!!!-->
  340. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  341. <!-- 信息列表 -->
  342. <select id="getNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
  343. SELECT * FROM
  344. (
  345. SELECT
  346. DN.NOTICE_ID AS "noticeId",
  347. DN.NOTICE_TITLE AS "noticeTitle",
  348. DN.NOTICE_CONTENT AS "noticeContent",
  349. DN.INSERT_TIME AS "insertTime",
  350. DN.INSERT_USERNAME AS "insertUsername"
  351. FROM DIL_NOTICE DN
  352. WHERE DN.DELETED !=1
  353. ORDER BY DN.INSERT_TIME DESC
  354. )
  355. <where>
  356. <if test="noticeId!= null">
  357. and
  358. <foreach collection="noticeId" item="item" open="(" separator="," close=")">
  359. "noticeId" in #{item}
  360. </foreach>
  361. </if>
  362. <if test="noticeTitle!= null">
  363. and
  364. <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
  365. "noticeTitle" in #{item}
  366. </foreach>
  367. </if>
  368. <if test="noticeContent!= null">
  369. and
  370. <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
  371. "noticeContent" in #{item}
  372. </foreach>
  373. </if>
  374. <if test="insertTime!= null">
  375. and
  376. <foreach collection="insertTime" item="item" open="(" separator="," close=")">
  377. "insertTime" in #{item}
  378. </foreach>
  379. </if>
  380. <if test="insertUsername!= null">
  381. and
  382. <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
  383. "insertUsername" in #{item}
  384. </foreach>
  385. </if>
  386. </where>
  387. </select>
  388. <!--承运商查询通知-->
  389. <select id="getCarrierNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
  390. SELECT * FROM
  391. (
  392. SELECT
  393. DN.NOTICE_ID AS "noticeId",
  394. DN.NOTICE_TITLE AS "noticeTitle",
  395. DN.NOTICE_CONTENT AS "noticeContent",
  396. DN.INSERT_TIME AS "insertTime",
  397. DN.INSERT_USERNAME AS "insertUsername"
  398. FROM DIL_NOTICE DN
  399. WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=1)
  400. ORDER BY DN.INSERT_TIME DESC
  401. )
  402. <where>
  403. <if test="noticeId!= null">
  404. and
  405. <foreach collection="noticeId" item="item" open="(" separator="," close=")">
  406. "noticeId" in #{item}
  407. </foreach>
  408. </if>
  409. <if test="noticeTitle!= null">
  410. and
  411. <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
  412. "noticeTitle" in #{item}
  413. </foreach>
  414. </if>
  415. <if test="noticeContent!= null">
  416. and
  417. <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
  418. "noticeContent" in #{item}
  419. </foreach>
  420. </if>
  421. <if test="insertTime!= null">
  422. and
  423. <foreach collection="insertTime" item="item" open="(" separator="," close=")">
  424. "insertTime" in #{item}
  425. </foreach>
  426. </if>
  427. <if test="insertUsername!= null">
  428. and
  429. <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
  430. "insertUsername" in #{item}
  431. </foreach>
  432. </if>
  433. </where>
  434. </select>
  435. <!--销售公司查询通知-->
  436. <select id="getMarketingNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
  437. SELECT * FROM
  438. (
  439. SELECT
  440. DN.NOTICE_ID AS "noticeId",
  441. DN.NOTICE_TITLE AS "noticeTitle",
  442. DN.NOTICE_CONTENT AS "noticeContent",
  443. DN.INSERT_TIME AS "insertTime",
  444. DN.INSERT_USERNAME AS "insertUsername"
  445. FROM DIL_NOTICE DN
  446. WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=2)
  447. ORDER BY DN.INSERT_TIME DESC
  448. )
  449. </select>
  450. <!--收货用户查询通知-->
  451. <select id="getClientNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
  452. SELECT * FROM
  453. (
  454. SELECT
  455. DN.NOTICE_ID AS "noticeId",
  456. DN.NOTICE_TITLE AS "noticeTitle",
  457. DN.NOTICE_CONTENT AS "noticeContent",
  458. DN.INSERT_TIME AS "insertTime",
  459. DN.INSERT_USERNAME AS "insertUsername"
  460. FROM DIL_NOTICE DN
  461. WHERE DN.DELETED !=1 and (DN.PERMISSION=0 or DN.PERMISSION=3)
  462. ORDER BY DN.INSERT_TIME DESC
  463. )
  464. </select>
  465. <!--根据Id查询公告-->
  466. <select id="getNoticeById" resultType="java.util.LinkedHashMap" >
  467. SELECT
  468. DN.NOTICE_ID AS "noticeId",
  469. DN.NOTICE_TITLE AS "noticeTitle",
  470. DN.NOTICE_CONTENT AS "noticeContent",
  471. DN.INSERT_TIME AS "insertTime",
  472. DN.INSERT_USERNAME AS "insertUsername"
  473. FROM DIL_NOTICE DN
  474. WHERE DN.NOTICE_ID=#{id}
  475. </select>
  476. <!--根据permission查询最新公告-->
  477. <select id="getNewNoticeByPermission" resultType="java.util.LinkedHashMap" >
  478. SELECT
  479. DN.NOTICE_ID AS "noticeId",
  480. DN.NOTICE_TITLE AS "noticeTitle",
  481. DN.NOTICE_CONTENT AS "noticeContent",
  482. DN.INSERT_TIME AS "insertTime",
  483. DN.INSERT_USERNAME AS "insertUsername"
  484. FROM DIL_NOTICE DN
  485. WHERE DN.INSERT_TIME = (SELECT MAX(DN.INSERT_TIME) FROM DIL_NOTICE DN WHERE DN.PERMISSION = #{permission} OR DN.PERMISSION =0)
  486. </select>
  487. <!-- /* DN.INSERT_TIME = DN.PERMISSION =#{permission} OR DN.PERMISSION =0 AND*/-->
  488. </mapper>