|
@@ -0,0 +1,105 @@
|
|
|
|
+<?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.post.mapper.PostPublisherMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="PostPublisher" id="PostPublisherResult">
|
|
|
|
+ <result property="publisherId" column="publisher_id" />
|
|
|
|
+ <result property="publisherName" column="publisher_name" />
|
|
|
|
+ <result property="nickName" column="nick_name" />
|
|
|
|
+ <result property="publisherEmail" column="publisher_email" />
|
|
|
|
+ <result property="publisherPhonenumber" column="publisher_phonenumber" />
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
+ <result property="publisherAddress" column="publisher_address" />
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
|
+ <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" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectPostPublisherVo">
|
|
|
|
+ select publisher_id, publisher_name, nick_name, publisher_email, publisher_phonenumber, status, publisher_address, del_flag, create_by, create_time, update_by, update_time, remark from post_publisher
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectPostPublisherList" parameterType="PostPublisher" resultMap="PostPublisherResult">
|
|
|
|
+ <include refid="selectPostPublisherVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="publisherName != null and publisherName != ''"> and publisher_name like concat('%', #{publisherName}, '%')</if>
|
|
|
|
+ <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
|
+ <if test="publisherEmail != null and publisherEmail != ''"> and publisher_email = #{publisherEmail}</if>
|
|
|
|
+ <if test="publisherPhonenumber != null and publisherPhonenumber != ''"> and publisher_phonenumber = #{publisherPhonenumber}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
+ <if test="publisherAddress != null and publisherAddress != ''"> and publisher_address = #{publisherAddress}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectPostPublisherByPublisherId" parameterType="Long" resultMap="PostPublisherResult">
|
|
|
|
+ <include refid="selectPostPublisherVo"/>
|
|
|
|
+ where publisher_id = #{publisherId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertPostPublisher" parameterType="PostPublisher" useGeneratedKeys="true" keyProperty="publisherId">
|
|
|
|
+ insert into post_publisher
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="publisherName != null and publisherName != ''">publisher_name,</if>
|
|
|
|
+ <if test="nickName != null and nickName != ''">nick_name,</if>
|
|
|
|
+ <if test="publisherEmail != null">publisher_email,</if>
|
|
|
|
+ <if test="publisherPhonenumber != null">publisher_phonenumber,</if>
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
+ <if test="publisherAddress != null">publisher_address,</if>
|
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
|
|
|
|
+ <if test="nickName != null and nickName != ''">#{nickName},</if>
|
|
|
|
+ <if test="publisherEmail != null">#{publisherEmail},</if>
|
|
|
|
+ <if test="publisherPhonenumber != null">#{publisherPhonenumber},</if>
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
+ <if test="publisherAddress != null">#{publisherAddress},</if>
|
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updatePostPublisher" parameterType="PostPublisher">
|
|
|
|
+ update post_publisher
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="publisherName != null and publisherName != ''">publisher_name = #{publisherName},</if>
|
|
|
|
+ <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
|
+ <if test="publisherEmail != null">publisher_email = #{publisherEmail},</if>
|
|
|
|
+ <if test="publisherPhonenumber != null">publisher_phonenumber = #{publisherPhonenumber},</if>
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
|
+ <if test="publisherAddress != null">publisher_address = #{publisherAddress},</if>
|
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where publisher_id = #{publisherId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deletePostPublisherByPublisherId" parameterType="Long">
|
|
|
|
+ delete from post_publisher where publisher_id = #{publisherId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deletePostPublisherByPublisherIds" parameterType="String">
|
|
|
|
+ delete from post_publisher where publisher_id in
|
|
|
|
+ <foreach item="publisherId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{publisherId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|