<?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="***.alatus.mapper.TActivityRemarkMapper">
<resultMap id="BaseResultMap" type="***.alatus.model.TActivityRemark">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="note_content" jdbcType="VARCHAR" property="noteContent" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<result column="deleted" jdbcType="INTEGER" property="deleted" />
</resultMap>
<resultMap id="ActivityRemarkResultMap" type="***.alatus.model.TActivityRemark">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="note_content" jdbcType="VARCHAR" property="noteContent" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<result column="deleted" jdbcType="INTEGER" property="deleted" />
<association property="createByDO" javaType="***.alatus.model.TUser">
<id column="createId" jdbcType="INTEGER" property="id" />
<result column="createName" jdbcType="VARCHAR" property="name" />
</association>
<association property="editByDO" javaType="***.alatus.model.TUser">
<id column="editId" jdbcType="INTEGER" property="id" />
<result column="editName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, activity_id, note_content, create_time, create_by, edit_time, edit_by, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_activity_remark
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectActivityRemarkByPage" resultMap="ActivityRemarkResultMap">
select
tar.*,
tu1.id createById,tu1.name createByName,
tu2.id editById,tu2.name editByName
from t_activity_remark tar left join t_user tu1 on tar.create_by = tu1.id
left join t_user tu2 on tar.edit_by = tu2.id
where tar.id = #{activityId,jdbcType=INTEGER}
<where>
${filterSQL}
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_activity_remark
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="***.alatus.model.TActivityRemark" useGeneratedKeys="true">
insert into t_activity_remark (activity_id, note_content, create_time,
create_by, edit_time, edit_by,
deleted)
values (#{activityId,jdbcType=INTEGER}, #{noteContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER},
#{deleted,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="***.alatus.model.TActivityRemark" useGeneratedKeys="true">
insert into t_activity_remark
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="activityId != null">
activity_id,
</if>
<if test="noteContent != null">
note_content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="activityId != null">
#{activityId,jdbcType=INTEGER},
</if>
<if test="noteContent != null">
#{noteContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
<if test="deleted != null">
#{deleted,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="***.alatus.model.TActivityRemark">
update t_activity_remark
<set>
<if test="activityId != null">
activity_id = #{activityId,jdbcType=INTEGER},
</if>
<if test="noteContent != null">
note_content = #{noteContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="***.alatus.model.TActivityRemark">
update t_activity_remark
set activity_id = #{activityId,jdbcType=INTEGER},
note_content = #{noteContent,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER},
deleted = #{deleted,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
<?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="***.alatus.mapper.TActivityRemarkMapper">
<resultMap id="BaseResultMap" type="***.alatus.model.TActivityRemark">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="note_content" jdbcType="VARCHAR" property="noteContent" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<result column="deleted" jdbcType="INTEGER" property="deleted" />
</resultMap>
<resultMap id="ActivityRemarkResultMap" type="***.alatus.model.TActivityRemark">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="note_content" jdbcType="VARCHAR" property="noteContent" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<result column="deleted" jdbcType="INTEGER" property="deleted" />
<association property="createByDO" javaType="***.alatus.model.TUser">
<id column="createId" jdbcType="INTEGER" property="id" />
<result column="createName" jdbcType="VARCHAR" property="name" />
</association>
<association property="editByDO" javaType="***.alatus.model.TUser">
<id column="editId" jdbcType="INTEGER" property="id" />
<result column="editName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, activity_id, note_content, create_time, create_by, edit_time, edit_by, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_activity_remark
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectActivityRemarkByPage" resultMap="ActivityRemarkResultMap">
select
tar.*,
tu1.id createById,tu1.name createByName,
tu2.id editById,tu2.name editByName
from t_activity_remark tar left join t_user tu1 on tar.create_by = tu1.id
left join t_user tu2 on tar.edit_by = tu2.id
where tar.id = #{activityId,jdbcType=INTEGER}
<where>
${filterSQL}
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_activity_remark
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="***.alatus.model.TActivityRemark" useGeneratedKeys="true">
insert into t_activity_remark (activity_id, note_content, create_time,
create_by, edit_time, edit_by,
deleted)
values (#{activityId,jdbcType=INTEGER}, #{noteContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER},
#{deleted,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="***.alatus.model.TActivityRemark" useGeneratedKeys="true">
insert into t_activity_remark
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="activityId != null">
activity_id,
</if>
<if test="noteContent != null">
note_content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
<if test="deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="activityId != null">
#{activityId,jdbcType=INTEGER},
</if>
<if test="noteContent != null">
#{noteContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
<if test="deleted != null">
#{deleted,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="***.alatus.model.TActivityRemark">
update t_activity_remark
<set>
<if test="activityId != null">
activity_id = #{activityId,jdbcType=INTEGER},
</if>
<if test="noteContent != null">
note_content = #{noteContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
<if test="deleted != null">
deleted = #{deleted,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="***.alatus.model.TActivityRemark">
update t_activity_remark
set activity_id = #{activityId,jdbcType=INTEGER},
note_content = #{noteContent,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER},
deleted = #{deleted,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>