<?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.casic.missiles.modular.system.dao.VisitorApplyMapper"> <select id="selectApplyList" resultType="com.casic.missiles.modular.system.model.VisitorApply"> SELECT * FROM bus_visit_apply WHERE 1=1 <if test="request.keywords != null and request.keywords !=''"> and (apply_no like concat('%',#{request.keywords},'%') or staff_code like concat('%',#{request.keywords},'%') or visitor_name like concat('%',#{request.keywords},'%') or visitor_phone like concat('%',#{request.keywords},'%')) </if> <if test="request.startTime != null and request.startTime !=''"> and in_time >= #{request.startTime} </if> <if test="request.endTime != null and request.endTime != ''"> and out_time <= #{request.endTime} </if> <if test="request.status != null and request.status != ''"> and visitor_apply_status = #{request.status} </if> ORDER BY create_time DESC </select> <select id="getMessageList" parameterType="string" resultType="hashmap"> SELECT t1.message_id, t2.staff_code, t2.visitor_name, t2.visitor_apply_status, DATE_FORMAT(t2.in_time,'%Y/%m/%d %H:%i:%s') as in_time, DATE_FORMAT(t2.out_time,'%Y/%m/%d %H:%i:%s') as out_time, DATE_FORMAT(t1.create_time,'%Y/%m/%d %H:%i:%s') as create_time FROM bus_message t1 LEFT JOIN bus_visit_apply t2 ON t1.message_id = t2.apply_no WHERE 1 = 1 AND t1.`status` = '0' and t1.open_id = #{openid} ORDER BY t1.create_time desc </select> </mapper>