EngVehicleRecordMapper.xml 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhgd.scs.mapper.EngVehicleRecordMapper">
  6. <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.EngVehicleRecord">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="vehicleId" column="vehicle_id" jdbcType="BIGINT"/>
  9. <result property="projectId" column="project_id" jdbcType="BIGINT"/>
  10. <result property="plateNo" column="plate_no" jdbcType="VARCHAR"/>
  11. <result property="flag" column="flag" jdbcType="INTEGER"/>
  12. <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
  13. <result property="inOutType" column="in_out_type" jdbcType="INTEGER"/>
  14. </resultMap>
  15. <select id="pagelist" resultType="com.zhgd.scs.domain.vo.EngVehicleRecordVo">
  16. SELECT v.*,ev.unit_name,ev.id_card,ev.gender
  17. FROM eng_vehicle_record v
  18. left join eng_vehicle ev on v.vehicle_id = ev.id
  19. WHERE v.project_id=#{projectId}
  20. <if test="inOutType!=null">
  21. AND v.in_out_type = #{inOutType}
  22. </if>
  23. <if test="plateNo!=null and plateNo!= ''">
  24. AND v.plate_no LIKE concat('%',#{plateNo},'%')
  25. </if>
  26. order by record_time desc
  27. </select>
  28. </mapper>