| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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.finikes.oc.base.dao.NoticeDao">
- <insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
- parameterType="com.finikes.oc.base.entity.Notice">
- INSERT INTO t_notice (type, title ,
- second_title, content,
- publish_time, create_time, update_time, cid, uid)
- VALUES (#{type}, #{title} ,
- #{secondTitle}, #{content},
- #{publishTime}, #{createTime}, #{updateTime}, #{cid}, #{uid})
- </insert>
- <update id="update" parameterType="com.finikes.oc.base.entity.Notice">
- UPDATE t_notice SET type = #{type}, title = #{title},
- second_title = #{secondTitle}, content = #{content}, publish_time = #{publishTime},
- create_time = #{createTime}, update_time = #{updateTime}, cid = #{cid}, uid = #{uid}
- WHERE id = #{id}
- </update>
- <update id="updateSelective">
- UPDATE t_notice
- <set>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="title != null">
- title = #{title},
- </if>
- <if test="secondTitle != null">
- second_title = #{secondTitle},
- </if>
- <if test="content != null">
- content = #{content},
- </if>
- <if test="publishTime != null">
- publish_time = #{publishTime},
- </if>
- <if test="createTime != null">
- create_time = #{createTime},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime},
- </if>
- <if test="cid">
- cid = #{cid},
- </if>
- <if test="uid">
- uid = #{uid}
- </if>
- </set>
- WHERE id = #{id}
- </update>
- <select id="selectByPrimaryKey" parameterType="integer" resultType="com.finikes.oc.base.entity.Notice">
- SELECT id, type, title , second_title, content, publish_time, create_time, update_time, cid, uid
- FROM t_notice
- WHERE id = #{primaryKey}
- </select>
- <select id="selectByType" resultType="com.finikes.oc.base.entity.Notice">
- SELECT id, type, title , second_title, content, publish_time, create_time, update_time, cid, uid
- FROM t_notice
- <where>
- <if test="type != null">
- type = #{type}
- </if>
- </where>
- ORDER BY id DESC
- </select>
- <delete id="deleteByPrimaryKey" parameterType="integer">
- DELETE
- FROM t_notice
- WHERE id = #{primaryKey}
- </delete>
- </mapper>
|