| | |
| | | <?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="Map"> |
| | | select p.id,results,p.state,p.create_time,p.inspection_id,user_id,results,type,user_name |
| | | from lims_laboratory.plan p left join lims_laboratory.inspection i |
| | | on i.id=p.inspection_id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | |
| | | <select id="selectInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.PlanDto"> |
| | | select i.mid , p.inspection_id , p.state, p.create_time, p.name userName, i.name inspectUserName |
| | | from (select inspection_id, state, plan.create_time, name |
| | | from lims_laboratory.plan |
| | | left join lims_laboratory.user on plan.user_id = user.id) p |
| | | left join (select inspection.id, name, iml.id mid |
| | | from lims_laboratory.inspection |
| | | left join lims_laboratory.user on user.id = inspection.inspect_user_id |
| | | left join lims_laboratory.inspection_material_list iml on inspection.id = iml.inspection_id) i |
| | | on p.inspection_id = i.id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | </mapper> |