|
@@ -5,100 +5,101 @@
|
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
|
-->
|
|
|
<mapper namespace="com.ym.mec.web.dal.dao.SysMessageDao">
|
|
|
-
|
|
|
- <resultMap type="com.ym.mec.web.dal.entity.SysMessage" id="SysMessage">
|
|
|
- <result column="id_" property="id" />
|
|
|
- <result column="title_" property="title" />
|
|
|
- <result column="content_" property="content" />
|
|
|
- <result column="type_" property="type" />
|
|
|
- <result column="status_" property="status" />
|
|
|
- <result column="receiver_" property="receiver" />
|
|
|
- <result column="send_time_" property="sendTime" />
|
|
|
- <result column="error_msg_" property="errorMsg" />
|
|
|
- <result column="create_on_" property="createOn" />
|
|
|
- <result column="modify_on_" property="modifyOn" />
|
|
|
- <result column="user_id_" property="userId" />
|
|
|
- <result column="memo_" property="memo" />
|
|
|
- <result column="read_status_" property="readStatus" />
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <select id="get" resultMap="SysMessage" >
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.web.dal.entity.SysMessage" id="SysMessage">
|
|
|
+ <result column="id_" property="id"/>
|
|
|
+ <result column="title_" property="title"/>
|
|
|
+ <result column="content_" property="content"/>
|
|
|
+ <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="receiver_" property="receiver"/>
|
|
|
+ <result column="send_time_" property="sendTime"/>
|
|
|
+ <result column="error_msg_" property="errorMsg"/>
|
|
|
+ <result column="create_on_" property="createOn"/>
|
|
|
+ <result column="modify_on_" property="modifyOn"/>
|
|
|
+ <result column="user_id_" property="userId"/>
|
|
|
+ <result column="memo_" property="memo"/>
|
|
|
+ <result column="read_status_" property="readStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="SysMessage">
|
|
|
SELECT * FROM sys_message WHERE id_ = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="SysMessage">
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="SysMessage">
|
|
|
SELECT * FROM sys_message ORDER BY id_
|
|
|
</select>
|
|
|
-
|
|
|
- <!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.ym.mec.web.dal.entity.SysMessage" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- INSERT INTO sys_message (id_,title_,content_,type_,status_,receiver_,send_time_,error_msg_,create_on_,modify_on_,user_id_,memo_,read_status_) VALUES(#{id},#{title},#{content},#{type},#{status},#{receiver},#{sendTime},#{errorMsg},#{createOn},#{modifyOn},#{userId},#{memo},#{readStatus})
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.ym.mec.web.dal.entity.SysMessage">
|
|
|
- UPDATE sys_message <set>
|
|
|
-<if test="status != null">
|
|
|
-status_ = #{status},
|
|
|
-</if>
|
|
|
-<if test="receiver != null">
|
|
|
-receiver_ = #{receiver},
|
|
|
-</if>
|
|
|
-<if test="modifyOn != null">
|
|
|
-modify_on_ = #{modifyOn},
|
|
|
-</if>
|
|
|
-<if test="id != null">
|
|
|
-id_ = #{id},
|
|
|
-</if>
|
|
|
-<if test="sendTime != null">
|
|
|
-send_time_ = #{sendTime},
|
|
|
-</if>
|
|
|
-<if test="readStatus != null">
|
|
|
-read_status_ = #{readStatus},
|
|
|
-</if>
|
|
|
-<if test="content != null">
|
|
|
-content_ = #{content},
|
|
|
-</if>
|
|
|
-<if test="memo != null">
|
|
|
-memo_ = #{memo},
|
|
|
-</if>
|
|
|
-<if test="userId != null">
|
|
|
-user_id_ = #{userId},
|
|
|
-</if>
|
|
|
-<if test="errorMsg != null">
|
|
|
-error_msg_ = #{errorMsg},
|
|
|
-</if>
|
|
|
-<if test="title != null">
|
|
|
-title_ = #{title},
|
|
|
-</if>
|
|
|
-<if test="createOn != null">
|
|
|
-create_on_ = #{createOn},
|
|
|
-</if>
|
|
|
-<if test="type != null">
|
|
|
-type_ = #{type},
|
|
|
-</if>
|
|
|
-</set> WHERE id_ = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <!-- 根据主键删除一条记录 -->
|
|
|
- <delete id="delete" >
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.web.dal.entity.SysMessage" useGeneratedKeys="true" keyColumn="id"
|
|
|
+ keyProperty="id">
|
|
|
+ <!--
|
|
|
+ <selectKey resultClass="int" keyProperty="id" >
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ INSERT INTO sys_message
|
|
|
+ (id_,title_,content_,type_,status_,receiver_,send_time_,error_msg_,create_on_,modify_on_,user_id_,memo_,read_status_)
|
|
|
+ VALUES(#{id},#{title},#{content},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{receiver},#{sendTime},#{errorMsg},now(),now(),#{userId},#{memo},#{readStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.ym.mec.web.dal.entity.SysMessage">
|
|
|
+ UPDATE sys_message
|
|
|
+ <set>
|
|
|
+ <if test="status != null">
|
|
|
+ status_ = #{status typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
|
|
|
+ </if>
|
|
|
+ <if test="receiver != null">
|
|
|
+ receiver_ = #{receiver},
|
|
|
+ </if>
|
|
|
+ <if test="modifyOn != null">
|
|
|
+ modify_on_ = #{modifyOn},
|
|
|
+ </if>
|
|
|
+ <if test="sendTime != null">
|
|
|
+ send_time_ = #{sendTime},
|
|
|
+ </if>
|
|
|
+ <if test="readStatus != null">
|
|
|
+ read_status_ = #{readStatus typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ content_ = #{content},
|
|
|
+ </if>
|
|
|
+ <if test="memo != null">
|
|
|
+ memo_ = #{memo},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ user_id_ = #{userId},
|
|
|
+ </if>
|
|
|
+ <if test="errorMsg != null">
|
|
|
+ error_msg_ = #{errorMsg},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title_ = #{title},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type_ = #{type typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete">
|
|
|
DELETE FROM sys_message WHERE id_ = #{id}
|
|
|
</delete>
|
|
|
-
|
|
|
- <!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="SysMessage" parameterType="map">
|
|
|
- SELECT * FROM sys_message ORDER BY id_ <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="SysMessage" parameterType="map">
|
|
|
+ SELECT * FROM sys_message ORDER BY id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM sys_message
|
|
|
</select>
|
|
|
</mapper>
|