<?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.qiaoba.module.system.mapper.SysPostMapper">

    <select id="checkPostNameUnique" resultType="string">
        select post_id from sys_post
        where post_name = #{postName}
        <if test="postId != null and postId != ''">
            and post_id != #{postId}
        </if>
        limit 1
    </select>

    <select id="checkPostCodeUnique" resultType="string">
        select post_id from sys_post
        where post_code = #{postCode}
        <if test="postId != null and postId != ''">
            and post_id != #{postId}
        </if>
        limit 1
    </select>

</mapper>
