Bonus-Cloud-JYY-Smart-Canteen/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/PersonSettingMapper.xml

39 lines
1.5 KiB
XML
Raw Normal View History

<?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.bonus.canteen.core.ims.mapper.PersonSettingMapper">
<select id="getList" resultType="com.bonus.canteen.core.ims.model.PersonSetting">
SELECT id, name, phone, sex, role_id as roleId, photo_url as photoUrl,ips.create_time as createTime,
if(role_id = 1,'供应商',sd.dict_label) as roleName
FROM ims_person_setting ips
left join sys_dict_data sd on ips.role_id = sd.dict_value and sd.dict_type = 'person_role'
<where>
and ips.del_flag = 1
<if test="searchValue != null and searchValue != ''">
and (
ips.name like concat('%', #{searchValue}, '%')
or ips.phone like concat('%', #{searchValue}, '%')
)
</if>
<if test="id != null">
and ips.id = #{id}
</if>
2025-10-20 15:47:27 +08:00
<if test="roleId != null and roleId != ''">
and ips.role_id = #{roleId}
</if>
<if test="type != null and type != '' and type == 'supplier'">
and ips.role_id = 1
</if>
<if test="type != null and type != '' and type != 'supplier'">
and ips.role_id != 1
</if>
</where>
</select>
<delete id="delById">
update ims_person_setting set del_flag = 0 where id = #{id}
</delete>
</mapper>