src/main/resources/mybatis/system/PostMapper.xml

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?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.project.system.post.mapper.PostMapper">

	<resultMap type="Post" id="PostResult">
		<id     property="postId"        column="post_id"       />
		<result property="postCode"      column="post_code"     />
		<result property="postName"      column="post_name"     />
		<result property="postSort"      column="post_sort"     />
		<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"        />
	</resultMap>
	
	<sql id="selectPostVo">
        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark 
		from sys_post
    </sql>
	
	<select id="selectPostList" parameterType="Post" resultMap="PostResult">
	    <include refid="selectPostVo"/>
		<where>
			<if test="postCode != null and postCode != ''">
				AND post_code like concat('%', #{postCode}, '%')
			</if>
			<if test="status != null and status != ''">
				AND status = #{status}
			</if>
			<if test="postName != null and postName != ''">
				AND post_name like concat('%', #{postName}, '%')
			</if>
		</where>
	</select>
	
	<select id="selectPostAll" resultMap="PostResult">
		<include refid="selectPostVo"/>
	</select>
	
	<select id="selectPostsByUserId" parameterType="Long" resultMap="PostResult">
		SELECT p.post_id, p.post_name, p.post_code
		FROM sys_user u
			 LEFT JOIN sys_user_post up ON u.user_id = up.user_id
			 LEFT JOIN sys_post p ON up.post_id = p.post_id
		WHERE up.user_id = #{userId}
	</select>
	
	<select id="selectPostById" parameterType="Long" resultMap="PostResult">
		<include refid="selectPostVo"/>
		where post_id = #{postId}
	</select>
	
	<select id="checkPostNameUnique" parameterType="String" resultMap="PostResult">
		<include refid="selectPostVo"/>
		 where post_name=#{postName} limit 1
	</select>
后面还有 50 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。