<?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.ruoyi.system.mapper.stamp.StampExamineExtMapper">

  <select id="listByParam" resultType="com.ruoyi.system.domain.stamp.StampExamine">
    select * from stamp_examine where 1=1
    <if test="title != null and title != ''">
       and title like concat('%',#{title},'%')
    </if>
    <if test="status != null and status != ''">
      and status = #{status}
    </if>
    <if test="userId != null and userId != ''">
      and(create_user = #{userId} or id in(select bus_id from car_dinner_examine_user where user_id = #{userId} and type='STAMP'))
    </if>
    order by create_time desc
  </select>
</mapper>