<?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.zcloud.basic.info.persistence.mapper.UserChangeRecordMapper">
    <select id="getChangerRecordInfoById" resultType="com.zcloud.basic.info.persistence.dataobject.UserChangeRecordDO">
        select ucr.*,u.name as userName
        from user_change_record ucr
                 left join user u on ucr.user_id = u.id
        where ucr.delete_enum = 'FALSE'
          and ucr.corpinfo_id_after =#{corpinfoId}
          and ucr.user_id =#{userId}
          and ucr.status =#{status}
        order by ucr.create_time desc
            limit 1
    </select>
</mapper>

