oil-station/fuintBackend/fuint-repository/src/main/resources/mapper/TAccountMapper.xml

24 lines
868 B
XML
Raw Normal View History

2023-10-09 11:06:01 +08:00
<?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.fuint.repository.mapper.TAccountMapper">
2023-10-11 13:22:16 +08:00
<select id="listAccount" resultType="com.fuint.repository.model.TAccount">
SELECT
ta.*,sd.dept_name
FROM
`t_account` ta
left join sys_dept sd on sd.dept_id = ta.dept_id
<if test="accountInfo.realName != null and accountInfo.realName != ''">
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
</if>
<if test="accountInfo.deptId != null">
AND ta.dept_id = #{accountInfo.deptId}
</if>
<!-- 数据范围过滤 -->
<if test="ownDeptStr != null and ownDeptStr!=''">
AND sd.ancestors like concat (#{ownDeptStr},'%')
</if>
order by create_time desc
2023-10-09 11:06:01 +08:00
2023-10-11 13:22:16 +08:00
</select>
2023-10-09 11:06:01 +08:00
</mapper>