You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
5.0 KiB

5 days ago
<?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.ruoyi.system.mapper.colums.YjPracticeMomentsMapper">
<resultMap type="YjPracticeMoments" id="YjPracticeMomentsResult">
<result property="id" column="id" />
<result property="title" column="title" />
<result property="image" column="image" />
<result property="readNum" column="read_num" />
<result property="startTime" column="start_time" />
<result property="content" column="content" />
<result property="status" column="status" />
<result property="modifyTime" column="modify_time" />
<result property="deptId" column="dept_id" />
</resultMap>
<sql id="selectYjPracticeMomentsVo">
select
yj_practice_moments.id,
yj_practice_moments.title,
yj_practice_moments.image,
yj_practice_moments.read_num,
yj_practice_moments.start_time,
yj_practice_moments.content,
yj_practice_moments.status,
yj_practice_moments.modify_time,
yj_practice_moments.dept_id
from yj_practice_moments left join sys_dept on yj_practice_moments.dept_id = sys_dept.dept_id
</sql>
<select id="selectYjPracticeMomentsList" parameterType="YjPracticeMoments" resultMap="YjPracticeMomentsResult">
<include refid="selectYjPracticeMomentsVo"/>
<where>
<if test="title != null and title != ''"> and yj_practice_moments.title = #{title}</if>
<if test="image != null and image != ''"> and yj_practice_moments.image = #{image}</if>
<if test="readNum != null "> and yj_practice_moments.read_num = #{readNum}</if>
<if test="startTime != null "> and yj_practice_moments.start_time = #{startTime}</if>
<if test="content != null and content != ''"> and yj_practice_moments.content = #{content}</if>
<if test="status != null "> and yj_practice_moments.status = #{status}</if>
<if test="modifyTime != null "> and yj_practice_moments.modify_time = #{modifyTime}</if>
<if test="deptId != null "> and yj_practice_moments.dept_id = #{deptId}</if>
<if test="tenantId != null "> and sys_dept.tenant_id = #{tenantId}</if>
</where>
</select>
<select id="selectYjPracticeMomentsById" parameterType="String" resultMap="YjPracticeMomentsResult">
<include refid="selectYjPracticeMomentsVo"/>
where yj_practice_moments.id = #{id}
</select>
<insert id="insertYjPracticeMoments" parameterType="YjPracticeMoments">
insert into yj_practice_moments
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="title != null">title,</if>
<if test="image != null">image,</if>
<if test="readNum != null">read_num,</if>
<if test="startTime != null">start_time,</if>
<if test="content != null">content,</if>
<if test="status != null">status,</if>
<if test="modifyTime != null">modify_time,</if>
<if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="title != null">#{title},</if>
<if test="image != null">#{image},</if>
<if test="readNum != null">#{readNum},</if>
<if test="startTime != null">#{startTime},</if>
<if test="content != null">#{content},</if>
<if test="status != null">#{status},</if>
<if test="modifyTime != null">#{modifyTime},</if>
<if test="deptId != null">#{deptId},</if>
</trim>
</insert>
<update id="updateYjPracticeMoments" parameterType="YjPracticeMoments">
update yj_practice_moments
<trim prefix="SET" suffixOverrides=",">
<if test="title != null">title = #{title},</if>
<if test="image != null">image = #{image},</if>
<if test="readNum != null">read_num = #{readNum},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="content != null">content = #{content},</if>
<if test="status != null">status = #{status},</if>
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
</trim>
where yj_practice_moments.id = #{id}
</update>
<delete id="deleteYjPracticeMomentsById" parameterType="String">
delete from yj_practice_moments where yj_practice_moments.id = #{id}
</delete>
<delete id="deleteYjPracticeMomentsByIds" parameterType="String">
delete from yj_practice_moments where yj_practice_moments.id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>