|
|
|
@ -1,16 +1,16 @@
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.ruoyi.szxc.mapper.SzxcNewsMapper">
|
|
|
|
<mapper namespace="com.ruoyi.szxc.mapper.SzxcNewsMapper">
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="SzxcNews" id="SzxcNewsResult">
|
|
|
|
<resultMap type="SzxcNews" id="SzxcNewsResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="title" column="title" />
|
|
|
|
<result property="title" column="title" />
|
|
|
|
<result property="type" column="type" />
|
|
|
|
<result property="type" column="type" />
|
|
|
|
<result property="picture" column="picture" />
|
|
|
|
<result property="picture" column="picture" />
|
|
|
|
<result property="content" column="content" />
|
|
|
|
<result property="content" column="content" />
|
|
|
|
<result property="leave" column="leave" />
|
|
|
|
<result property="sort" column="sort" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
@ -21,28 +21,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectSzxcNewsVo">
|
|
|
|
<sql id="selectSzxcNewsVo">
|
|
|
|
select id, title, type, picture, content, leave, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_news
|
|
|
|
select id, title, type, picture, content, sort, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_news
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcNewsList" parameterType="SzxcNews" resultMap="SzxcNewsResult">
|
|
|
|
<select id="selectSzxcNewsList" parameterType="SzxcNews" resultMap="SzxcNewsResult">
|
|
|
|
<include refid="selectSzxcNewsVo"/>
|
|
|
|
<include refid="selectSzxcNewsVo"/>
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
<if test="picture != null and picture != ''"> and picture = #{picture}</if>
|
|
|
|
<if test="picture != null and picture != ''"> and picture = #{picture}</if>
|
|
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
|
<if test="leave != null and leave != ''"> and leave = #{leave}</if>
|
|
|
|
<if test="sort != null and sort != ''"> and sort = #{sort}</if>
|
|
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
|
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSzxcNewsById" parameterType="Long" resultMap="SzxcNewsResult">
|
|
|
|
<select id="selectSzxcNewsById" parameterType="Long" resultMap="SzxcNewsResult">
|
|
|
|
<include refid="selectSzxcNewsVo"/>
|
|
|
|
<include refid="selectSzxcNewsVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertSzxcNews" parameterType="SzxcNews" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
<insert id="insertSzxcNews" parameterType="SzxcNews" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into szxc_news
|
|
|
|
insert into szxc_news
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="type != null">type,</if>
|
|
|
|
<if test="type != null">type,</if>
|
|
|
|
<if test="picture != null">picture,</if>
|
|
|
|
<if test="picture != null">picture,</if>
|
|
|
|
<if test="content != null">content,</if>
|
|
|
|
<if test="content != null">content,</if>
|
|
|
|
<if test="leave != null">leave,</if>
|
|
|
|
<if test="sort != null">sort,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
@ -58,13 +58,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="deptId != null">dept_id,</if>
|
|
|
|
<if test="deptId != null">dept_id,</if>
|
|
|
|
<if test="deptName != null">dept_name,</if>
|
|
|
|
<if test="deptName != null">dept_name,</if>
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="title != null and title != ''">#{title},</if>
|
|
|
|
<if test="title != null and title != ''">#{title},</if>
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
<if test="picture != null">#{picture},</if>
|
|
|
|
<if test="picture != null">#{picture},</if>
|
|
|
|
<if test="content != null">#{content},</if>
|
|
|
|
<if test="content != null">#{content},</if>
|
|
|
|
<if test="leave != null">#{leave},</if>
|
|
|
|
<if test="sort != null">#{sort},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="deptId != null">#{deptId},</if>
|
|
|
|
<if test="deptId != null">#{deptId},</if>
|
|
|
|
<if test="deptName != null">#{deptName},</if>
|
|
|
|
<if test="deptName != null">#{deptName},</if>
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateSzxcNews" parameterType="SzxcNews">
|
|
|
|
<update id="updateSzxcNews" parameterType="SzxcNews">
|
|
|
|
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
<if test="picture != null">picture = #{picture},</if>
|
|
|
|
<if test="picture != null">picture = #{picture},</if>
|
|
|
|
<if test="content != null">content = #{content},</if>
|
|
|
|
<if test="content != null">content = #{content},</if>
|
|
|
|
<if test="leave != null">leave = #{leave},</if>
|
|
|
|
<if test="sort != null">sort = #{sort},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSzxcNewsByIds" parameterType="String">
|
|
|
|
<delete id="deleteSzxcNewsByIds" parameterType="String">
|
|
|
|
delete from szxc_news where id in
|
|
|
|
delete from szxc_news where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
|