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

41 lines
1.2 KiB
XML

<?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">
<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
where account_status != -1
<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="ancestors != null and ancestors!=''">
AND sd.ancestors like concat (#{ancestors},'%')
</if>
order by create_time desc
</select>
<select id="getStationmasterByStoreId" resultType="com.fuint.repository.model.TAccount">
select
ta.*
from
`t_account` ta
left join t_account_duty td on ta.acct_id = td.acct_id
where
ta.dept_id = #{deptId}
and td.duty_id = #{roleIds}
</select>
</mapper>