127 lines
6.3 KiB
127 lines
6.3 KiB
<?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.SysSpecialMapper">
|
|
|
|
<resultMap type="SysSpecial" id="SysSpecialResult">
|
|
<result property="specialId" column="special_id" />
|
|
<result property="specialTitle" column="special_title" />
|
|
<result property="specialContent" column="special_content" />
|
|
<result property="status" column="status" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="type" column="type" />
|
|
<result property="fileUrl" column="file_url" />
|
|
<result property="fileName" column="file_name" />
|
|
<result property="specialUrl" column="special_url" />
|
|
<result property="columnId" column="column_id" />
|
|
<result property="columnName" column="column_name" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysSpecialVo">
|
|
select special_id, special_title, special_content, status, create_by, create_time, update_by, update_time, remark,type,file_url,file_name,special_url,column_id,column_name
|
|
from sys_special
|
|
</sql>
|
|
|
|
<select id="selectSysSpecialById" parameterType="String" resultMap="SysSpecialResult">
|
|
<include refid="selectSysSpecialVo"/>
|
|
where special_id = #{specialId}
|
|
</select>
|
|
|
|
<select id="selectSysSpecialList" parameterType="SysSpecial" resultMap="SysSpecialResult">
|
|
<include refid="selectSysSpecialVo"/>
|
|
<where>
|
|
<if test="specialTitle != null and specialTitle != ''">
|
|
AND special_title like concat('%', #{specialTitle}, '%')
|
|
</if>
|
|
<if test="columnName != null and columnName != ''">
|
|
AND column_name like concat('%', #{columnName}, '%')
|
|
</if>
|
|
<if test="createBy != null and createBy != ''">
|
|
AND create_by like concat('%', #{createBy}, '%')
|
|
</if>
|
|
<if test="status != null">
|
|
AND status = #{status}
|
|
</if>
|
|
<if test="columnId != null">
|
|
AND column_id = #{columnId}
|
|
</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<insert id="insertSysSpecial" parameterType="SysSpecial">
|
|
insert into sys_special (
|
|
<if test="specialId != null and specialId != ''">special_id, </if>
|
|
<if test="specialTitle != null and specialTitle != '' ">special_title, </if>
|
|
<if test="specialContent != null and specialContent != '' ">special_content, </if>
|
|
<if test="status != null and status != '' ">status, </if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="type != null and createBy != ''">type,</if>
|
|
<if test="fileUrl != null and fileUrl != '' ">file_url, </if>
|
|
<if test="fileName != null and fileName != '' ">file_name, </if>
|
|
<if test="specialUrl != null and specialUrl != '' ">special_url, </if>
|
|
<if test="columnId != null and columnId != '' ">column_id, </if>
|
|
<if test="columnName != null and columnName != '' ">column_name, </if>
|
|
create_time
|
|
)values(
|
|
<if test="specialId != null and specialId != ''">#{specialId}, </if>
|
|
<if test="specialTitle != null and specialTitle != ''">#{specialTitle}, </if>
|
|
<if test="specialContent != null and specialContent != ''">#{specialContent}, </if>
|
|
<if test="status != null and status != ''">#{status}, </if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
<if test="fileUrl != null and fileUrl != ''">#{fileUrl}, </if>
|
|
<if test="fileName != null and fileName != ''">#{fileName}, </if>
|
|
<if test="specialUrl != null and specialUrl != ''">#{specialUrl}, </if>
|
|
<if test="columnId != null and columnId != ''">#{columnId}, </if>
|
|
<if test="columnName != null and columnName != ''">#{columnName}, </if>
|
|
now()
|
|
)
|
|
</insert>
|
|
|
|
<update id="updateSysSpecial" parameterType="SysSpecial">
|
|
update sys_special
|
|
<set>
|
|
<if test="specialTitle != null and specialTitle != ''">special_title = #{specialTitle}, </if>
|
|
<if test="specialContent != null">special_content = #{specialContent}, </if>
|
|
<if test="status != null and status != ''">status = #{status}, </if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="fileUrl != null">file_url = #{fileUrl}, </if>
|
|
<if test="fileName != null">file_name = #{fileName}, </if>
|
|
<if test="specialUrl != null">special_url = #{specialUrl}, </if>
|
|
<if test="columnId != null">column_id = #{columnId}, </if>
|
|
<if test="columnName != null">column_name = #{columnName}, </if>
|
|
update_time = now()
|
|
</set>
|
|
where special_id = #{specialId}
|
|
</update>
|
|
|
|
<delete id="deleteSysSpecialByIds" parameterType="String">
|
|
delete from sys_special where special_id in
|
|
<foreach item="specialId" collection="array" open="(" separator="," close=")">
|
|
#{specialId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectSysSpecialHomeList" parameterType="SysSpecial" resultMap="SysSpecialResult">
|
|
<include refid="selectSysSpecialVo"/>
|
|
<where>
|
|
<if test="specialTitle != null and specialTitle != ''">
|
|
AND special_title like concat('%', #{specialTitle}, '%')
|
|
</if>
|
|
<if test="createBy != null and createBy != ''">
|
|
AND create_by like concat('%', #{createBy}, '%')
|
|
</if>
|
|
AND status = '0'
|
|
</where>
|
|
order by create_time desc limit 10
|
|
</select>
|
|
|
|
</mapper> |