| | |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.`equipment_name` like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.measurement_unit like concat('%',#{dto.unit},'%') |
| | | <if test="dto.unit!=null and dto.unit!=''"> |
| | | and m.measurement_unit like concat('%',#{dto.unit},'%') |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | IF(IFNULL(i.result, 0) > 0, 1, 0) status, |
| | | (SELECT name FROM `user` u WHERE p.measure_person = u.id) measureName, |
| | | i.`code` iCode, |
| | | p.unit unit, |
| | | p.create_time createTime |
| | | FROM (SELECT id, measure_person, create_Person, begin_Time, end_Time, planned_order_number, create_time |
| | | FROM (SELECT id, unit ,measure_person, create_Person, begin_Time, end_Time, planned_order_number, create_time |
| | | from metering_plan |
| | | where 1=1 |
| | | <if test="dto.plannedOrderNumber!=null and dto.plannedOrderNumber!=''"> |
| | | and planned_order_number=#{plannedOrderNumber} |
| | | and planned_order_number like concat('%',#{dto.plannedOrderNumber},'%') |
| | | </if> |
| | | LIMIT #{limitPage.start},#{limitPage.end}) p |
| | | LEFT JOIN metrical_information i ON p.id = i.plan |
| | |
| | | <select id="getTotal" resultType="java.util.Map"> |
| | | select count(id) num from metering_plan where 1=1 |
| | | <if test="dto.plannedOrderNumber!=null and dto.plannedOrderNumber!=''"> |
| | | and planned_order_number=#{plannedOrderNumber} |
| | | and planned_order_number like concat('%',#{dto.plannedOrderNumber},'%') |
| | | </if> |
| | | </select> |
| | | <select id="getPlanMeasureInstrument" |
| | | resultMap="measureInsAndPlanMap"> |
| | | SELECT m.planned_order_number plannedOrderNumber, |
| | | (SELECT NAME FROM USER WHERE id = m.measure_person) measureName, |
| | | m.begin_time beginTime, |
| | | m.end_time endTime, |
| | | m.unit unit, |
| | | u.`name` createName, |
| | | m.create_time createTime, |
| | | im.equipment_code equipmentCode, |
| | | im.equipment_name equipmentName, |
| | | im.measuring_range measuringRange, |
| | | im.term_validity termValidity, |
| | | im.result result, |
| | | im.end_date endDate, |
| | | im.imName imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode, |
| | | im.id imId, |
| | | im.uncertainty uncertainty , |
| | | im.performance_index performanceIndex , |
| | | im.remarks remarks |
| | | FROM metering_plan m |
| | | LEFT JOIN `user` u ON m.create_Person = u.id |
| | | LEFT JOIN ( |
| | | SELECT i.equipment_code, |
| | | i.equipment_name, |
| | | i.measuring_range, |
| | | im.id, |
| | | i.term_validity, |
| | | im.uncertainty, |
| | | im.performance_index, |
| | | im.remarks, |
| | | im.result, |
| | | im.end_date, |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | | im.create_time, |
| | | im.measurement_unit, |
| | | im.`code`, |
| | | im.plan |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} |
| | | LIMIT #{limitPage.start} |
| | | , #{limitPage.end} |
| | | ) im ON m.id = im.plan |
| | | WHERE 1 = 1 |
| | | AND m.id = #{id} |
| | | </select> |
| | | <select id="limitGetPlanMeasureInstrument" resultMap="MetricalInfoAndInsMap"> |
| | | SELECT i.equipment_code equipmentCode, |
| | | i.equipment_name equipmentName, |
| | | i.measuring_range measuringRange, |
| | | i.term_validity termValidity, |
| | | im.result result, |
| | | im.end_date endDate, |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode, |
| | | im.id imId, |
| | | im.uncertainty uncertainty , |
| | | im.performance_index performanceIndex , |
| | | im.remarks remarks |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} LIMIT #{limitPage.start} |
| | | , #{limitPage.end} |
| | | </select> |
| | | <select id="countPlanMeasurIns" resultType="java.util.Map"> |
| | | SELECT count(im.id) total |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} |
| | | </select> |
| | | |
| | | <resultMap id="MetricalInfoAndInsMap" type="MetricalInfoAndIns"> |
| | | <result property="code" column="imCode"/> |
| | | <result property="measurementUnit" column="imUnit"/> |
| | | <result property="imCreateTime" column="imCreateTime"/> |
| | | <result property="measurementName" column="imName"/> |
| | | <result property="endDate" column="endDate"/> |
| | | <result property="result" column="result"/> |
| | | <result property="termValidity" column="termValidity"/> |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | <result property="imId" column="imId"/> |
| | | <result property="performanceIndex" column="performanceIndex"/> |
| | | <result property="uncertainty" column="uncertainty"/> |
| | | <result property="remarks" column="remarks"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="measureInsAndPlanMap" type="meteringPlanAndInfoAndIns"> |
| | | <result property="id" column="id"/> |
| | | <result property="createPerson" column="createName"/> |
| | | <result property="beginTime" column="beginTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <result property="plannedOrderNumber" column="plannedOrderNumber"/> |
| | | <result property="measurePerson" column="measureName"/> |
| | | <result property="createTime" column="createTime"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="metricalInfoAndInsList" ofType="metricalInfoAndIns"> |
| | | <result property="code" column="imCode"/> |
| | | <result property="measurementUnit" column="imUnit"/> |
| | | <result property="imCreateTime" column="imCreateTime"/> |
| | | <result property="measurementName" column="imName"/> |
| | | <result property="endDate" column="endDate"/> |
| | | <result property="result" column="result"/> |
| | | <result property="termValidity" column="termValidity"/> |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | <result property="imId" column="imId"/> |
| | | <result property="performanceIndex" column="performanceIndex"/> |
| | | <result property="uncertainty" column="uncertainty"/> |
| | | <result property="remarks" column="remarks"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <resultMap id="MeteringPlanAndInfoMap" type="meteringPlanAndInfo"> |
| | | <result property="id" column="id"/> |
| | |
| | | <result property="plannedOrderNumber" column="plannedOrderNumber"/> |
| | | <result property="measurePerson" column="measureName"/> |
| | | <result property="createTime" column="createTime"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="resultList" ofType="MetricalInformation"> |
| | | <result property="code" column="iCode"/> |
| | | <result property="result" column="status"/> |