| | |
| | | <?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 mid , |
| | | p.inspection_id , |
| | | state , |
| | | create_time , |
| | | name , |
| | | material_name , |
| | | specifications_serial_number , |
| | | material_id , |
| | | material_supplier , |
| | | start_time , |
| | | end_time , |
| | | results , |
| | | material_location , |
| | | method , |
| | | material_batch , |
| | | material_reel_number , |
| | | material_num |
| | | from (select plan.user_id, plan.state, plan.create_time, plan.results, plan.inspection_id, name |
| | | from lims_laboratory.plan |
| | | join lims_laboratory.user u on plan.user_id = u.id) p |
| | | left join (select iml.id mid, |
| | | iml.specifications_serial_number, |
| | | iml.material_id, |
| | | iml.material_supplier, |
| | | ipl.start_time, |
| | | ipl.end_time, |
| | | iml.material_location, |
| | | iml.material_name, |
| | | ipl.method, |
| | | iml.material_batch, |
| | | iml.material_reel_number, |
| | | iml.material_num, |
| | | iml.inspection_id |
| | | from lims_laboratory.inspection_material_list iml |
| | | left join lims_laboratory.inspection_product_list ipl on iml.id = ipl.inspection_material_list_id) il |
| | | on p.inspection_id = il.inspection_id |
| | | <if test="state!=null"> |
| | | where state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | |
| | | <select id="selectInspection" resultType="com.yuanchu.limslaboratory.pojo.vo.FinPlanVo"> |
| | | 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> |