| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.yuanchu.limslaboratory.mapper.PlanMapper"> |
| | | |
| | | <!--æ¥è¯¢æ£éªè®¡å--> |
| | | <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo"> |
| | | select i.equipment_name device, |
| | | im.name samplename, |
| | | im.code sampleid, |
| | | im.specifications modelandspecification, |
| | | im.unit unit, |
| | | im.num amount, |
| | | ip.name checkproject, |
| | | u.name checker, |
| | | ip.start_time starttime, |
| | | ip.end_time finishtime, |
| | | ip.test_state state |
| | | from instrument i |
| | | left join (select ip.* |
| | | from inspection_product ip |
| | | right join (select instrument_id, max(ip.end_time) t |
| | | from inspection_product ip |
| | | group by instrument_id) it |
| | | on ip.instrument_id = it.instrument_id and ip.end_time = it.t) ip |
| | | on i.id = ip.instrument_id |
| | | left join inspection_material im on im.id = ip.inspection_material_id |
| | | left join user u on u.id = ip.user_id |
| | | <where> |
| | | <if test="device != null and device != null"> |
| | | and i.equipment_name = #{device} |
| | | </if> |
| | | <if test="user != null and user != null"> |
| | | and u.name = #{user} |
| | | </if> |
| | | <if test="beginTime != null and endTime != null"> |
| | | and ip.start_time between #{beginTime} and #{endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |