lj-zhgd-ht/bonus-modules/bonus-app/src/main/resources/mapper/BraceletMapper.xml

40 lines
1.5 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.bonus.app.mapper.BraceletMapper">
<select id="getBoxListById" resultType="com.bonus.app.entity.BoxEntity" >
select id boxId,box_name boxName
FROM tb_sh_box
WHERE team_id is not null
<if test="roleCode!=null and roleCode!='' and roleCode=='team'">
and team_id=#{teamId}
</if>
</select>
<select id="getBoxInfo" resultType="com.bonus.app.entity.BraceletEntity">
select blt.sh_code shCode,blt.id devId,peopel_type userType,
case
WHEN peopel_type=0 then tpe.name
WHEN peopel_type=1 then tlu.name
ELSE ''
END AS user_name ,
case
WHEN peopel_type=0 then tpe.phone
WHEN peopel_type=1 then tlu.phone
ELSE ''
END AS phone ,
case
WHEN peopel_type=0 then tpe.id_card
WHEN peopel_type=1 then tlu.id_card
ELSE ''
END AS id_card
FROM tb_bracelet blt
left join tb_people tpe on blt.bid_id=blt.id and peopel_type=0
left join tb_ls_user tlu on blt.bid_id=tlu.id and peopel_type=1
where blt.box_id=#{boxId}
</select>
<select id="getBoxInfoDetails" resultType="java.util.Map">
</select>
</mapper>