2024-08-02 16:40:13 +08:00
|
|
|
<?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.cms.mapper.ImitationMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="Imitation" id="ImitationResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="imitationTitle" column="imitation_title" />
|
|
|
|
|
<result property="imitationSummary" column="imitation_summary" />
|
|
|
|
|
<result property="imitationTeach" column="imitation_teach" />
|
|
|
|
|
<result property="imitationSchool" column="imitation_school" />
|
|
|
|
|
<result property="imitationLink" column="imitation_link" />
|
|
|
|
|
<result property="imitationCount" column="imitation_count" />
|
|
|
|
|
<result property="imitationType" column="imitation_type" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="imitationImage" column="imitation_image" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectImitationVo">
|
|
|
|
|
select id, imitation_image, imitation_title, imitation_summary, imitation_teach, imitation_school, imitation_link, imitation_count, imitation_type, remark, del_flag, create_time, create_by, update_time, update_by from imitation
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectImitationList" parameterType="Imitation" resultMap="ImitationResult">
|
|
|
|
|
<include refid="selectImitationVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="imitationTitle != null and imitationTitle != ''"> and imitation_title like concat('%', #{imitationTitle}, '%')</if>
|
|
|
|
|
<if test="imitationSummary != null and imitationSummary != ''"> and imitation_summary like concat('%', #{imitationSummary}, '%')</if>
|
|
|
|
|
<if test="imitationTeach != null and imitationTeach != ''"> and imitation_teach like concat('%', #{imitationTeach}, '%')</if>
|
|
|
|
|
<if test="imitationSchool != null and imitationSchool != ''"> and imitation_school like concat('%', #{imitationSchool}, '%')</if>
|
|
|
|
|
<if test="imitationLink != null and imitationLink != ''"> and imitation_link = #{imitationLink}</if>
|
|
|
|
|
<if test="imitationCount != null "> and imitation_count = #{imitationCount}</if>
|
|
|
|
|
<if test="imitationType != null "> and imitation_type = #{imitationType}</if>
|
|
|
|
|
</where>
|
2024-08-03 13:51:47 +08:00
|
|
|
order by create_time desc
|
2024-08-02 16:40:13 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectImitationById" parameterType="Long" resultMap="ImitationResult">
|
|
|
|
|
<include refid="selectImitationVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertImitation" parameterType="Imitation">
|
|
|
|
|
insert into imitation
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="imitationTitle != null and imitationTitle != ''">imitation_title,</if>
|
|
|
|
|
<if test="imitationSummary != null and imitationSummary != ''">imitation_summary,</if>
|
|
|
|
|
<if test="imitationTeach != null and imitationTeach != ''">imitation_teach,</if>
|
|
|
|
|
<if test="imitationSchool != null and imitationSchool != ''">imitation_school,</if>
|
|
|
|
|
<if test="imitationLink != null and imitationLink != ''">imitation_link,</if>
|
|
|
|
|
<if test="imitationCount != null">imitation_count,</if>
|
|
|
|
|
<if test="imitationType != null">imitation_type,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="delFlag != null">del_flag,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="imitationImage != null">imitation_image,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
|
<if test="imitationTitle != null and imitationTitle != ''">#{imitationTitle},</if>
|
|
|
|
|
<if test="imitationSummary != null and imitationSummary != ''">#{imitationSummary},</if>
|
|
|
|
|
<if test="imitationTeach != null and imitationTeach != ''">#{imitationTeach},</if>
|
|
|
|
|
<if test="imitationSchool != null and imitationSchool != ''">#{imitationSchool},</if>
|
|
|
|
|
<if test="imitationLink != null and imitationLink != ''">#{imitationLink},</if>
|
|
|
|
|
<if test="imitationCount != null">#{imitationCount},</if>
|
|
|
|
|
<if test="imitationType != null">#{imitationType},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="imitationImage != null">#{imitationImage},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="addCount" parameterType="Long">
|
|
|
|
|
update imitation set imitation_count = imitation_count + 1 where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateImitation" parameterType="Imitation">
|
|
|
|
|
update imitation
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="imitationTitle != null and imitationTitle != ''">imitation_title = #{imitationTitle},</if>
|
|
|
|
|
<if test="imitationSummary != null and imitationSummary != ''">imitation_summary = #{imitationSummary},</if>
|
|
|
|
|
<if test="imitationTeach != null and imitationTeach != ''">imitation_teach = #{imitationTeach},</if>
|
|
|
|
|
<if test="imitationSchool != null and imitationSchool != ''">imitation_school = #{imitationSchool},</if>
|
|
|
|
|
<if test="imitationLink != null and imitationLink != ''">imitation_link = #{imitationLink},</if>
|
|
|
|
|
<if test="imitationCount != null">imitation_count = #{imitationCount},</if>
|
|
|
|
|
<if test="imitationType != null">imitation_type = #{imitationType},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="imitationImage != null">update_by = #{imitationImage},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteImitationById" parameterType="Long">
|
|
|
|
|
delete from imitation where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteImitationByIds" parameterType="String">
|
|
|
|
|
delete from imitation where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|