<?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="org.jeecg.modules.fbsPerson.mapper.FbsPersonMapper">
    <select id="getPerAndDerp" resultType="org.jeecg.modules.fbsPerson.entity.FbsPerson">
        SELECT
            p.*,
            d.cDepName
        FROM
            Person p
            LEFT JOIN Department d ON p.cDepCode= d.cDepCode
            ORDER by p.cPersonName
    </select>

    <select id="getPerByCode" resultType="org.jeecg.modules.fbsPerson.entity.FbsPerson">
        SELECT
            p.*,
            d.cDepName as warehouseName,d.cDepCode as warehouseId
        FROM
            Person p
            LEFT JOIN Department d ON p.cDepCode= d.cDepCode
             where cpersonCode=#{code}
    </select>

</mapper>