123456789101112131415161718192021222324252627282930313233343536373839 |
- <?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.zhgd.scs.mapper.AccessLatestRecordMapper">
- <resultMap id="BaseResultMap" type="com.zhgd.scs.domain.AccessLatestRecord">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="idcard" column="idcard" jdbcType="VARCHAR"/>
- <result property="personId" column="person_id" jdbcType="BIGINT"/>
- <result property="projectId" column="project_id" jdbcType="BIGINT"/>
- <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
- <result property="recordType" column="record_type" jdbcType="INTEGER"/>
- </resultMap>
- <select id="pagelist" resultType="com.zhgd.scs.domain.vo.AccessLatestRecordVo">
- SELECT p.*,wt.name workerTypeName,u.abbr_name unitName, lp.name personName
- FROM access_latest_record p
- LEFT JOIN sys_worker_type wt ON wt.id = p.worker_type_id
- LEFT JOIN labor_unit u ON u.id = p.unit_id
- LEFT JOIN labor_person lp ON lp.id = p.person_id
- Where p.project_id = #{projectId}
- AND p.record_type = 0
- <if test="name!=null and name!= ''">
- AND lp.name like concat('%',#{name},'%')
- </if>
- <if test="unitId!=null ">
- AND p.unit_id = #{unitId}
- </if>
- <if test="workerTypeId!=null">
- AND p.worker_type_id = #{workerTypeId}
- </if>
- <if test="startDate!=null and endDate!=null">
- AND p.record_time BETWEEN #{startDate} AND #{endDate}
- </if>
- order by p.record_time desc
- </select>
- </mapper>
|