116 lines
4.2 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">
2021-12-31 09:23:41 +08:00
<!--suppress ALL -->
<mapper namespace="com.xhpc.user.mapper.XhpcCommonMapper">
<select id="getAppUser" resultType="map">
select
app_user_id as appUserId,
phone as phone,
is_refund_application as isRefundApplication,
is_refund as isRefund,
soc as socUser,
balance as balance,
avatar as avatar,
status,
weixin_open_id as weixinlogin,
alipay_open_id as alipayLogin,
weixin_login as weixinOpenId,
alipay_login as alipayLogin,
del_flag delFlag,
concat(0) as userType,
2022-01-10 13:52:59 +08:00
concat("C") as userTypeName,
2021-12-31 11:22:22 +08:00
tenant_id tenantId,
soc_protect socProtect,
create_time as createTime
from xhpc_app_user
where del_flag=0
<if test="phone !=null and phone !=''">
and phone =#{phone}
</if>
<if test="userId !=null">
and app_user_id =#{userId}
</if>
2022-01-04 10:19:03 +08:00
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
<select id="getCommunityUser" resultType="map">
select
community_personnel_id as appUserId,
account as account,
phone as phone,
is_refund_application as isRefundApplication,
is_refund as isRefund,
soc as socUser,
surplus_money as balance,
avatar as avatar,
status,
weixin_open_id as weixinlogin,
alipay_open_id as alipayLogin,
weixin_login as weixinOpenId,
alipay_login as alipayLogin,
2021-12-31 11:22:22 +08:00
tenant_id tenantId,
del_flag delFlag,
concat(2) as userType,
soc_protect socProtect,
2022-01-10 13:52:59 +08:00
concat("ST") as userTypeName,
2021-12-31 09:23:41 +08:00
<if test="serialNumber !=null and serialNumber !=''">
(select count(charging_station_id) from xhpc_mechanism where community_id=mechanism_id and source=0 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
</if>
create_time as createTime
from xhpc_community_personnel
where del_flag=0
<if test="phone !=null and phone !=''">
and account =#{phone}
</if>
<if test="userId !=null">
and community_personnel_id =#{userId}
</if>
2022-01-04 10:19:03 +08:00
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
<select id="getCustomersUser" resultType="map">
select
customers_personnel_id as appUserId,
account as account,
phone as phone,
is_refund_application as isRefundApplication,
is_refund as isRefund,
soc as socUser,
surplus_money as balance,
avatar as avatar,
status,
weixin_open_id as weixinlogin,
alipay_open_id as alipayLogin,
weixin_login as weixinOpenId,
alipay_login as alipayLogin,
del_flag delFlag,
2021-12-31 11:22:22 +08:00
tenant_id tenantId,
concat(3) as userType,
soc_protect socProtect,
2022-01-10 13:52:59 +08:00
concat("BE") as userTypeName,
2021-12-31 09:23:41 +08:00
<if test="serialNumber !=null and serialNumber !=''">
(select count(charging_station_id) from xhpc_mechanism where customers_id=mechanism_id and source=1 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
</if>
create_time as createTime
from xhpc_customers_personnel
where del_flag=0
<if test="phone !=null and phone !=''">
and account =#{phone}
</if>
<if test="userId !=null">
and customers_personnel_id =#{userId}
</if>
2022-01-04 10:19:03 +08:00
<if test="tenantId !=null and tenantId !=''">
and tenant_id =#{tenantId}
</if>
</select>
</mapper>