EngVehicleLatestRecordMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930
  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.EngVehicleLatestRecordMapper">
  6. <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.EngVehicleLatestRecord">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="vehicleId" column="vehicle_id" jdbcType="BIGINT"/>
  9. <result property="inOutType" column="in_out_type" jdbcType="INTEGER"/>
  10. <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
  11. <result property="plateNo" column="plate_no" jdbcType="VARCHAR"/>
  12. <result property="projectId" column="project_id" jdbcType="BIGINT"/>
  13. </resultMap>
  14. <select id="pagelist" resultType="com.zhgd.scs.domain.vo.EngVehicleLatestRecordVo">
  15. SELECT v.*,ev.vehicle_type,ev.vehicle_color,ev.name,ev.phone,ev.unit_name,ev.id_card,ev.gender
  16. FROM eng_vehicle_latest_record v
  17. left join eng_vehicle ev on v.vehicle_id = ev.id
  18. WHERE v.project_id=#{projectId} and v.in_out_type=0
  19. <if test="name!=null and name!= ''">
  20. AND ev.name LIKE concat('%',#{name},'%')
  21. </if>
  22. <if test="plateNo!=null and plateNo!= ''">
  23. AND v.plate_no LIKE concat('%',#{plateNo},'%')
  24. </if>
  25. order by record_time desc
  26. </select>
  27. </mapper>