123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.steerinfo.dil.mapper.DilNoticeMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilNotice">
- <id column="NOTICE_ID" jdbcType="DECIMAL" property="noticeId" />
- <result column="NOTICE_TITLE" jdbcType="VARCHAR" property="noticeTitle" />
- <result column="NOTICE_CONTENT" jdbcType="VARCHAR" property="noticeContent" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
- <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
- <result column="PERMISSION" jdbcType="VARCHAR" property="permission" />
- <result column="HISTORICAL_CHANGES" jdbcType="VARCHAR" property="historicalChanges"></result>
- <result column="UPDATE_TITLE" jdbcType="VARCHAR" property="updateTitle"></result>
- <result column="UPDATE_CONTENT" jdbcType="VARCHAR" property="updateContent"></result>
- <result column="STATUS" jdbcType="VARCHAR" property="status"></result>
- </resultMap>
- <sql id="columns">
- NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PERMISSION,HISTORICAL_CHANGES,UPDATE_TITLE,
- UPDATE_CONTENT,STATUS
- </sql>
- <sql id="columns_alias">
- t.NOTICE_ID, t.NOTICE_TITLE, t.NOTICE_CONTENT, t.INSERT_USERNAME, t.INSERT_TIME,
- t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PERMISSION,
- t.HISTORICAL_CHANGES,t.UPDATE_TITLE,t.UPDATE_CONTENT,t.STATUS
- </sql>
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM DIL_NOTICE
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM DIL_NOTICE t
- </sql>
- <sql id="where">
- <where>
- <if test="noticeId != null">
- and NOTICE_ID = #{noticeId}
- </if>
- <if test="noticeTitle != null and noticeTitle != ''">
- and NOTICE_TITLE = #{noticeTitle}
- </if>
- <if test="noticeContent != null and noticeContent != ''">
- and NOTICE_CONTENT = #{noticeContent}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="permission != null">
- and PERMISSION = #{permission}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="noticeId != null">
- and NOTICE_ID = #{noticeId}
- </if>
- <if test="noticeTitle != null and noticeTitle != ''">
- and NOTICE_TITLE LIKE '%${noticeTitle}%'
- </if>
- <if test="noticeContent != null and noticeContent != ''">
- and NOTICE_CONTENT LIKE '%${noticeContent}%'
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="permission != null">
- and PERMISSION = #{permission}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from DIL_NOTICE
- where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from DIL_NOTICE
- where 1!=1
- <if test="noticeTitle != null and noticeTitle != ''">
- or NOTICE_TITLE = #{noticeTitle}
- </if>
- <if test="noticeContent != null and noticeContent != ''">
- or NOTICE_CONTENT = #{noticeContent}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- <if test="deleted != null">
- or DELETED = #{deleted}
- </if>
- <if test="permission != null">
- or PERMISSION = #{permission}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.DilNotice">
- insert into DIL_NOTICE (NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
- PERMISSION)
- values (#{noticeId,jdbcType=DECIMAL}, #{noticeTitle,jdbcType=VARCHAR}, #{noticeContent,jdbcType=VARCHAR},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
- #{permission,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilNotice">
- insert into DIL_NOTICE
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="noticeId != null">
- NOTICE_ID,
- </if>
- <if test="noticeTitle != null">
- NOTICE_TITLE,
- </if>
- <if test="noticeContent != null">
- NOTICE_CONTENT,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- <if test="deleted != null">
- DELETED,
- </if>
- <if test="permission != null">
- PERMISSION,
- </if>
- <if test="status != null">
- STATUS,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="noticeId != null">
- #{noticeId,jdbcType=DECIMAL},
- </if>
- <if test="noticeTitle != null">
- #{noticeTitle,jdbcType=VARCHAR},
- </if>
- <if test="noticeContent != null">
- #{noticeContent,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="permission != null">
- #{permission,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- #{status,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilNotice">
- update DIL_NOTICE
- set NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
- NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- DELETED = #{deleted,jdbcType=DECIMAL},
- PERMISSION = #{permission,jdbcType=DECIMAL}
- where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilNotice">
- update DIL_NOTICE
- <set>
- <if test="noticeTitle != null">
- NOTICE_TITLE = #{noticeTitle,jdbcType=VARCHAR},
- </if>
- <if test="noticeContent != null">
- NOTICE_CONTENT = #{noticeContent,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- DELETED = #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="permission != null">
- PERMISSION = #{permission,jdbcType=DECIMAL},
- </if>
- <if test="historicalChanges != null">
- HISTORICAL_CHANGES = #{historicalChanges,jdbcType=DECIMAL},
- </if>
- </set>
- where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into DIL_NOTICE
- (NOTICE_ID,
- NOTICE_TITLE, NOTICE_CONTENT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETED, PERMISSION)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.noticeId,jdbcType=DECIMAL},
- #{item.noticeTitle,jdbcType=VARCHAR}, #{item.noticeContent,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.deleted,jdbcType=DECIMAL}, #{item.permission,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update DIL_NOTICE
- set
- NOTICE_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeId,jdbcType=DECIMAL}
- </foreach>
- ,NOTICE_TITLE=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeTitle,jdbcType=VARCHAR}
- </foreach>
- ,NOTICE_CONTENT=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.noticeContent,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
- </foreach>
- ,PERMISSION=
- <foreach collection="list" item="item" index="index" separator=" " open="case NOTICE_ID" close="end">
- when #{item.noticeId,jdbcType=DECIMAL} then #{item.permission,jdbcType=DECIMAL}
- </foreach>
- where NOTICE_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.noticeId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from DIL_NOTICE
- where NOTICE_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 信息列表 -->
- <select id="getNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT * FROM
- (
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername"
- FROM DIL_NOTICE DN
- WHERE DN.DELETED !=1
- ORDER BY DN.INSERT_TIME DESC
- )
- <where>
- <if test="noticeId!= null">
- and
- <foreach collection="noticeId" item="item" open="(" separator="," close=")">
- "noticeId" in #{item}
- </foreach>
- </if>
- <if test="noticeTitle!= null">
- and
- <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
- "noticeTitle" in #{item}
- </foreach>
- </if>
- <if test="noticeContent!= null">
- and
- <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
- "noticeContent" in #{item}
- </foreach>
- </if>
- <if test="insertTime!= null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="," close=")">
- "insertTime" in #{item}
- </foreach>
- </if>
- <if test="insertUsername!= null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
- "insertUsername" in #{item}
- </foreach>
- </if>
- </where>
- </select>
- <!--承运商查询通知-->
- <select id="getCarrierNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT * FROM
- (
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername",
- DN.PERMISSION AS "permission",
- DN.STATUS AS "status",
- DN.UPDATE_TITLE AS "updateTitle",
- DN.UPDATE_CONTENT AS "updateContent",
- DN.UPDATE_TIME AS "updateTime",
- DN.UPDATE_USERNAME AS "updateUsername"
- FROM DIL_NOTICE DN
- WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='chengyunshang')
- <if test="con!=null">
- and DN.NOTICE_TITLE || DN.INSERT_USERNAME like #{con}
- </if>
- ORDER BY DN.INSERT_TIME DESC
- )
- <where>
- <if test="noticeId!= null">
- and
- <foreach collection="noticeId" item="item" open="(" separator="," close=")">
- "noticeId" in #{item}
- </foreach>
- </if>
- <if test="noticeTitle!= null">
- and
- <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
- "noticeTitle" in #{item}
- </foreach>
- </if>
- <if test="noticeContent!= null">
- and
- <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
- "noticeContent" in #{item}
- </foreach>
- </if>
- <if test="insertTime!= null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- to_date(to_char("insertTime",'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')
- in to_date(#{item},'yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="insertUsername!= null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
- "insertUsername" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!--销售公司查询通知-->
- <select id="getMarketingNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT * FROM
- (
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername",
- DN.PERMISSION AS "permission",
- DN.STATUS AS "status",
- DN.UPDATE_TITLE AS "updateTitle",
- DN.UPDATE_CONTENT AS "updateContent",
- DN.UPDATE_TIME AS "updateTime",
- DN.UPDATE_USERNAME AS "updateUsername"
- FROM DIL_NOTICE DN
- WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='wuliuyunshubu')
- <if test="con!=null">
- and DN.NOTICE_TITLE || DN.INSERT_USERNAME like #{con}
- </if>
- ORDER BY DN.INSERT_TIME DESC
- )
- <where>
- <if test="noticeId!= null">
- and
- <foreach collection="noticeId" item="item" open="(" separator="," close=")">
- "noticeId" in #{item}
- </foreach>
- </if>
- <if test="noticeTitle!= null">
- and
- <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
- "noticeTitle" in #{item}
- </foreach>
- </if>
- <if test="noticeContent!= null">
- and
- <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
- "noticeContent" in #{item}
- </foreach>
- </if>
- <if test="insertTime!= null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="," close=")">
- "insertTime" in #{item}
- </foreach>
- </if>
- <if test="insertUsername!= null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
- "insertUsername" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!--收货用户查询通知-->
- <select id="getClientNoticeList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT * FROM
- (
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername",
- DN.PERMISSION AS "permission",
- DN.STATUS AS "status",
- DN.UPDATE_TITLE AS "updateTitle",
- DN.UPDATE_CONTENT AS "updateContent",
- DN.UPDATE_TIME AS "updateTime",
- DN.UPDATE_USERNAME AS "updateUsername"
- FROM DIL_NOTICE DN
- WHERE DN.DELETED !=1 and (DN.PERMISSION='qita' or DN.PERMISSION='shouhuokehu')
- <if test="con!=null">
- and DN.NOTICE_TITLE || DN.INSERT_USERNAME like #{con}
- </if>
- ORDER BY DN.INSERT_TIME DESC
- )
- <where>
- <if test="noticeId!= null">
- and
- <foreach collection="noticeId" item="item" open="(" separator="," close=")">
- "noticeId" in #{item}
- </foreach>
- </if>
- <if test="noticeTitle!= null">
- and
- <foreach collection="noticeTitle" item="item" open="(" separator="," close=")">
- "noticeTitle" in #{item}
- </foreach>
- </if>
- <if test="noticeContent!= null">
- and
- <foreach collection="noticeContent" item="item" open="(" separator="," close=")">
- "noticeContent" in #{item}
- </foreach>
- </if>
- <if test="insertTime!= null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="," close=")">
- "insertTime" in #{item}
- </foreach>
- </if>
- <if test="insertUsername!= null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="," close=")">
- "insertUsername" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!--根据Id查询公告-->
- <select id="getNoticeById" resultType="java.util.LinkedHashMap" >
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername",
- decode(DN.PERMISSION,'qita','全部可见',
- 'chengyunshang','承运商',
- 'wuliuyunshubu','销售公司',
- 'shouhuokehu','收货客户') "permission"
- FROM DIL_NOTICE DN
- WHERE DN.NOTICE_ID=#{id}
- </select>
- <!--根据Id查询公告(修改过后的)-->
- <select id="getNoticeById1" resultType="java.util.LinkedHashMap" >
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.UPDATE_TITLE AS "noticeTitle",
- DN.UPDATE_CONTENT AS "noticeContent",
- DN.UPDATE_TIME AS "insertTime",
- DN.UPDATE_USERNAME AS "insertUsername",
- decode(DN.PERMISSION,'qita','全部可见',
- 'chengyunshang','承运商',
- 'wuliuyunshubu','销售公司',
- 'shouhuokehu','收货客户') "permission"
- FROM DIL_NOTICE DN
- WHERE DN.NOTICE_ID=#{id}
- </select>
- <!--根据permission查询最新公告-->
- <select id="getNewNoticeByPermission" resultType="java.util.LinkedHashMap" >
- SELECT
- DN.NOTICE_ID AS "noticeId",
- DN.NOTICE_TITLE AS "noticeTitle",
- DN.NOTICE_CONTENT AS "noticeContent",
- DN.INSERT_TIME AS "insertTime",
- DN.INSERT_USERNAME AS "insertUsername"
- FROM DIL_NOTICE DN
- WHERE DN.INSERT_TIME = (SELECT MAX(DN.INSERT_TIME) FROM DIL_NOTICE DN WHERE DN.PERMISSION = #{permission} OR DN.PERMISSION =0)
- </select>
- <!-- /* DN.INSERT_TIME = DN.PERMISSION =#{permission} OR DN.PERMISSION =0 AND*/-->
- <!--获取信息-->
- <select id="getNoticeData" parameterType="java.lang.String" resultType="java.util.Map">
- select * from(
- SELECT DN.NOTICE_TITLE AS "noticetitle",
- DN.NOTICE_CONTENT AS "noticecontent",
- DN.INSERT_USERNAME AS "insertusername",
- DN.INSERT_TIME AS "inserttime",
- DN.NOTICE_ID AS "noticeId",
- (select count(DNU.NOTICE_ID) from DIL_NOTICE_USERS DNU
- LEFT JOIN DIL_NOTICE DN
- ON DN.NOTICE_ID=DNU.NOTICE_ID
- where DNU.STATUS =0
- and DNU.USER_ID=#{userId}
- and DN.INSERT_TIME <![CDATA[<]]> SYSDATE) "taskAllNum"
- FROM DIL_NOTICE_USERS DNU
- LEFT JOIN DIL_NOTICE DN
- ON DN.NOTICE_ID=DNU.NOTICE_ID
- WHERE DNU.USER_ID=#{userId}
- and sysdate > DN.INSERT_TIME
- order by DN.INSERT_TIME DESC)
- where rownum <![CDATA[<]]> 4
- </select>
- <!--获取信息-->
- <select id="getNoticeData1" resultType="java.util.Map">
- select
- t.NOTICE_TITLE AS "noticetitle",
- t.NOTICE_CONTENT AS "noticecontent",
- t.INSERT_USERNAME AS "insertusername",
- t.INSERT_TIME AS "inserttime",
- (select count(*) INSERT_USERNAME from DIL_NOTICE where PERMISSION = 0) AS "taskAllNum"
- from DIL_NOTICE t
- where t.PERMISSION = 0
- and t.Deleted =0
- </select>
- <!--向通知与用户中间表存储数据-->
- <insert id="insertIntoNoticeUser">
- INSERT INTO DIL_NOTICE_USERS
- (select DN.NOTICE_ID ,
- SU.USER_ID,
- SU.USER_NAME,
- SU.ORG_CODE,
- 0 "STATUS"
- from DIL_NOTICE DN ,"SSO".SYS_USER SU
- WHERE DN.NOTICE_ID=#{noticeId}
- AND SU.ORG_CODE=#{permission})
- </insert>
- <insert id="insertIntoNoticeUser1">
- INSERT INTO DIL_NOTICE_USERS
- (select DN.NOTICE_ID ,
- SU.USER_ID,
- SU.USER_NAME,
- SU.ORG_CODE,
- 0 "STATUS"
- from DIL_NOTICE DN ,"SSO".SYS_USER SU
- WHERE DN.NOTICE_ID=#{noticeId}
- AND SU.ORG_CODE != 'yunli')
- </insert>
- <update id="updateNotice">
- update DIL_NOTICE
- set NOTICE_TITLE= #{noticeTitle},
- NOTICE_CONTENT=#{noticeContent},
- INSERT_USERNAME=#{insertUsername},
- PERMISSION=#{permission},
- UPDATE_USERNAME=#{updateUsername},
- UPDATE_TIME=#{updateTime}
- where NOTICE_ID=#{noticeId}
- </update>
- <delete id="deleteNotice">
- delete from DIL_NOTICE DN
- where DN.notice_id=#{noticeId}
- </delete>
- <delete id="deleteNoticeUsers">
- delete from DIL_NOTICE_USERS DNU
- where DNU.notice_id=#{noticeId}
- </delete>
- <update id="updatestatus">
- update DIL_NOTICE_USERS DNU
- SET STATUS=1
- WHERE DNU.USER_ID=#{userId}
- and DNU.NOTICE_ID=#{noticeId}
- </update>
- <select id="gettaskAllNum" resultType="java.lang.Integer">
- select count(DNU.NOTICE_ID) from DIL_NOTICE_USERS DNU
- LEFT JOIN DIL_NOTICE DN
- ON DN.NOTICE_ID=DNU.NOTICE_ID
- where DNU.STATUS =0
- and DNU.USER_ID=#{userId}
- and DN.INSERT_TIME <![CDATA[<]]> SYSDATE
- </select>
- <select id="queryName" resultType="java.lang.String">
- select SU.USER_NAME "userName"
- from "SSO".SYS_USER SU
- where SU.USER_ID=#{userId}
- </select>
- <select id="getorgCode" resultType="java.lang.String">
- select DN.PERMISSION "permission"
- from DIL_NOTICE DN
- where DN.NOTICE_ID=#{noticeId}
- </select>
- <select id="gethistoryorgCode" resultMap="BaseResultMap">
- select *
- from DIL_NOTICE DN
- where DN.NOTICE_ID=#{noticeId}
- </select>
- <update id="updatehistorydata">
- update DIL_NOTICE
- set NOTICE_TITLE=#{noticeTitle},
- NOTICE_CONTENT=#{noticeContent},
- INSERT_USERNAME=#{insertUsername},
- INSERT_TIME=#{insertTime},
- UPDATE_TIME=null,UPDATE_TITLE=null,UPDATE_CONTENT=null,UPDATE_USERNAME=null,STATUS=0
- WHERE NOTICE_ID=#{noticeId}
- </update>
- <update id="updateTime">
- update DIL_NOTICE
- set INSERT_TIME=#{insertTime}
- where NOTICE_ID=#{noticeId}
- </update>
- <update id="modifyData">
- update DIL_NOTICE
- set UPDATE_TITLE=#{updateTitle},
- UPDATE_CONTENT=#{updateContent},
- UPDATE_USERNAME=#{updateUsername},
- UPDATE_TIME=#{updateTime},
- PERMISSION=#{permission},
- STATUS=#{status}
- WHERE NOTICE_ID=#{noticeId}
- </update>
- <select id="getStatus" resultType="java.lang.String">
- select DN.STATUS "status"
- from DIL_NOTICE DN
- where DN.NOTICE_ID=#{id}
- </select>
- <select id="getNoticeAll" resultType="java.util.Map">
- SELECT DN.NOTICE_TITLE AS "noticetitle",
- DN.NOTICE_CONTENT AS "noticecontent",
- DN.INSERT_USERNAME AS "insertusername",
- DN.INSERT_TIME AS "inserttime",
- DN.NOTICE_ID AS "noticeId",
- DNU.STATUS "status"
- FROM DIL_NOTICE DN
- LEFT JOIN DIL_NOTICE_USERS DNU ON DNU .NOTICE_ID=DN .NOTICE_ID
- WHERE DNU.USER_ID=#{userId}
- AND SYSDATE > DN.INSERT_TIME
- AND DNU .NOTICE_ID IS NOT NULL
- ORDER BY DN.INSERT_TIME DESC
- FETCH NEXT 99 ROWS ONLY
- </select>
- <update id="readAll">
- update DIL_NOTICE_USERS
- SET STATUS=1
- WHERE USER_ID=#{userId}
- and NOTICE_ID IN(
- SELECT NOTICE_ID FROM DIL_NOTICE
- WHERE INSERT_USERNAME = #{insertUserName}
- )
- </update>
- <select id="getNoticeUser" resultType="java.util.Map">
- SELECT DN.NOTICE_TITLE AS "noticetitle",
- DN.NOTICE_CONTENT AS "noticecontent",
- DN.INSERT_USERNAME AS "insertusername",
- DN.INSERT_TIME AS "inserttime",
- DN.NOTICE_ID AS "noticeId",
- SU .USER_NAME "userName",
- decode(DNU.STATUS,1,'已读','未读') "status"
- FROM DIL_NOTICE DN
- LEFT JOIN DIL_NOTICE_USERS DNU ON DNU .NOTICE_ID=DN .NOTICE_ID
- LEFT JOIN SSO.SYS_USER SU ON SU .USER_ID = DNU .USER_ID
- <where>
- <if test="noticeId!=null">
- AND DNU.NOTICE_ID=#{noticeId}
- </if>
- <if test="userId!=null">
- AND DNU.USER_ID=#{userId}
- </if>
- AND DNU.NOTICE_ID IS NOT NULL
- AND SYSDATE > DN.INSERT_TIME
- ORDER BY DN.INSERT_TIME DESC
- </where>
- </select>
- <select id="findErrorOrder" resultType="java.util.Map">
- SELECT APO .PURCHASE_ORDER_NO "purchaseOrderNo",
- APO .PURCHASE_ORDER_BUYER "purchaseOrderBuyer"
- FROM AMS_PURCHASE_ORDER APO
- LEFT JOIN DIL_BATCH DB ON DB .BATCH_ID = APO .BATCH_ID
- LEFT JOIN DIL_NOTICE DN ON DN .INSERT_UPDATE_REMARK = APO.PURCHASE_ORDER_NO
- WHERE
- APO.DELETED=0
- AND (DB .RESULT_FOREIGN_SHIP_NAME='烧结' OR DB .RESULT_FOREIGN_SHIP_NAME='泰昕')
- AND NVL(DN .DELETED,1) != 0
- ORDER BY APO .INSERT_TIME DESC
- </select>
- <insert id="insertIntoNoticeUserToOne">
- INSERT INTO DIL_NOTICE_USERS
- (select DN.NOTICE_ID ,
- SU.USER_ID,
- SU.USER_NAME,
- SU.ORG_CODE,
- 0 "STATUS"
- from DIL_NOTICE DN ,"SSO".SYS_USER SU
- WHERE DN.NOTICE_ID=#{noticeId}
- AND SU.USER_ID=#{userId})
- </insert>
- </mapper>
|