<?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.dg.core.db.gen.mapper.MenuMapper">
|
|
<resultMap type="com.dg.core.db.gen.entity.MenuEntity" id="MenuEntityResult">
|
<id property="id" column="id" />
|
<id property="title" column="title" />
|
<id property="createTime" column="create_time" />
|
<id property="updateTime" column="update_time" />
|
<id property="remark" column="remark" />
|
<id property="parentId" column="parent_id" />
|
|
</resultMap>
|
|
<sql id="selectMenuEntityVo">
|
SELECT
|
id,
|
title,
|
create_time,
|
update_time,
|
parent_id,
|
remark
|
FROM
|
automessage_menu
|
</sql>
|
|
<select id="selectConfigList" resultMap="MenuEntityResult">
|
<include refid="selectMenuEntityVo"/>
|
<!-- <where>-->
|
<!-- <if test="userName != null and userName != ''">-->
|
<!-- AND user_name like concat('%', #{userName}, '%')-->
|
<!-- </if>-->
|
<!-- <if test="streetName != null and streetName != ''">-->
|
<!-- AND street_name like concat('%', #{streetName}, '%')-->
|
<!-- </if>-->
|
<!-- <if test="loginName != null and loginName != ''">-->
|
<!-- AND login_name like concat('%', #{loginName}, '%')-->
|
<!-- </if>-->
|
<!-- <if test="phonenumber != null and phonenumber != ''">-->
|
<!-- AND phonenumber like concat('%', #{phonenumber}, '%')-->
|
<!-- </if>-->
|
<!-- <if test="roleId != null and roleId != ''">-->
|
<!-- AND role_id=#{roleId}-->
|
<!-- </if>-->
|
|
<!-- </where>-->
|
|
order by create_time desc
|
</select>
|
|
|
<insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.MenuEntity">
|
insert into automessage_menu (
|
<if test="id != null">id,</if>
|
<if test="title != null and title != '' ">title,</if>
|
<if test="parentId != null">parent_id,</if>
|
<if test="remark != null and remark != '' ">remark,</if>
|
update_time,
|
create_time
|
)values(
|
<if test="id != null">#{id},</if>
|
<if test="title != null and title != '' ">#{title},</if>
|
<if test="parentId != null">#{parentId},</if>
|
<if test="remark != null and remark != '' ">#{remark},</if>
|
sysdate(),
|
sysdate()
|
)
|
</insert>
|
|
<update id="updateConfig" parameterType="com.dg.core.db.gen.entity.MenuEntity">
|
update automessage_menu
|
<set>
|
<if test="id != null">id=#{id},</if>
|
<if test="title != null and title != '' ">title=#{title},</if>
|
<if test="parentId != null">parent_id=#{parentId},</if>
|
<if test="remark != null and remark != '' ">remark=#{remark},</if>
|
update_time=sysdate()
|
</set>
|
where id= #{Id}
|
</update>
|
|
<delete id="deleteConfigById" parameterType="Long">
|
delete from automessage_menu where id= #{Id}
|
</delete>
|
|
<select id="countNum" resultType="integer">
|
select count(id) from automessage_menu
|
</select>
|
|
</mapper>
|