rtos-mini-service4/mapper/target/classes/mappers/client/OtherExtendMapper.xml

112 lines
2.9 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.haitongauto.mapper.client.OtherExtendMapper">
<!--读取最近10条公告数据-->
<select id="getLastAnnouncementsList" resultType="com.haitongauto.models.pojo.Announcement">
select
id,
title,
abstracts,
announcement,
author,
reading_volume,
create_time,
update_time,
is_del
from applet_announcements
where is_del=0
order by create_time desc
limit 10
</select>
<!--获取发送给指定用户的指令信息-->
<select id="getEntryInstructionsForUsers" resultType="com.haitongauto.models.pojo.EntryInstruct">
select
id,
appointment_id,
users_id,
users_name,
truck_number,
yard_name,
create_time,
update_time,
is_del
from applet_entry_instruct
where is_del=0
and users_id=#{users_id}
order by create_time desc
limit 10
</select>
<!--根据请求类型获取一条请求配置数据-->
<select id="getRequesterForType" parameterType="int" resultType="com.haitongauto.models.pojo.Requester">
select
id,
url,
param_map,
request_type,
type_description,
create_time,
update_time,
is_del
from applet_requester
where is_del=0
and request_type=#{request_type}
</select>
<!--根据code代码获取配置结果数据-->
<select id="getServiceConfigForCode" parameterType="String" resultType="String">
select
config_content
from applet_service_config
where is_del=0
and config_code=#{config_code}
limit 1
</select>
<!--根据用户的小程序 openid 获取用户在数据库里的数据-->
<select id="getUsersForOpenId" resultType="com.haitongauto.models.pojo.Users">
select
access_token,
id,
users_name,
wx_openid,
wx_unionid,
wx_nick,
wx_sex,
wx_head_sculpture,
tel_number,
id_code,
create_time,
update_time,
is_del
from applet_users
where is_del=0
and wx_openid=#{wx_openid}
limit 1
</select>
<!--根据板车号查用户信息-->
<select id="getUsersByTruckNo" resultType="com.haitongauto.models.pojo.Users">
select
id,
users_name,
wx_openid,
wx_unionid,
wx_nick,
wx_sex,
wx_head_sculpture,
tel_number,
id_code,
create_time,
update_time,
is_del
from applet_users
where id in (select users_id from applet_truck where applet_truck.is_del=0 and truck_number=#{truck_number})
limit 1
</select>
</mapper>