| New file |
| | |
| | | <?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.example.erp.mapper.pp.ReportingWorkDetailMapper"> |
| | | <!--返工新增--> |
| | | <resultMap id="reworkAdd" type="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="rework_team" property="reworkTeam"/> |
| | | <result column="breakage_quantity" property="breakageQuantity"/> |
| | | <result column="return_process" property="returnProcess"/> |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="responsible_equipment" property="responsibleEquipment"/> |
| | | <result column="responsible_team" property="responsibleTeam"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="reportingWork" javaType="com.example.erp.entity.pp.ReportingWork"> |
| | | <result column="process_id" property="processId"/> |
| | | </association> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="project" property="project"/> |
| | | <result column="batch" property="batch"/> |
| | | </association> |
| | | |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result column="shape" property="shape"/> |
| | | |
| | | </association> |
| | | |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result column="glass_child" property="glassChild"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="technology_number" property="technologyNumber"/> |
| | | <result column="glass_address" property="glassAddress"/> |
| | | <result column="child_height" property="childHeight"/> |
| | | |
| | | </association> |
| | | |
| | | <!-- <result column="order_id" property="orderId"/>--> |
| | | |
| | | </resultMap> |
| | | |
| | | <!--返工管理页面--> |
| | | <resultMap id="reworkManage" type="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | |
| | | <id column="id" property="id"/> |
| | | <result column="rework_team" property="reworkTeam"/> |
| | | <result column="breakage_number" property="breakageNumber"/> |
| | | <result column="return_process" property="returnProcess"/> |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="breakage_type" property="breakageType"/> |
| | | <result column="responsible_equipment" property="responsibleEquipment"/> |
| | | <result column="responsible_team" property="responsibleTeam"/> |
| | | <result column="rework_area" property="reworkArea"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="quality_inspector" property="qualityInspector"/> |
| | | |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="reportingWork" javaType="com.example.erp.entity.pp.ReportingWork"> |
| | | <result column="process_id" property="processId"/> |
| | | </association> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="project" property="project"/> |
| | | <result column="batch" property="batch"/> |
| | | </association> |
| | | |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result column="shape" property="shape"/> |
| | | </association> |
| | | |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result column="glass_child" property="glassChild"/> |
| | | <!--<result column="order_number" property="orderNumber"/>--> |
| | | <result column="technology_number" property="technologyNumber"/> |
| | | <result column="glass_address" property="glassAddress"/> |
| | | <result column="child_height" property="childHeight"/> |
| | | <result column="child_width" property="childWidth"/> |
| | | |
| | | </association> |
| | | <association property="OrderProcessDetail" javaType="com.example.erp.entity.sd.OrderProcessDetail"> |
| | | <result column="reporting_work_num" property="reportingWorkNum"/> |
| | | </association> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <!--获取返工新增数据--> |
| | | <select id="queryReworkAdd" resultMap="reworkAdd"> |
| | | select * from v_rework |
| | | <where> |
| | | rework_team is null |
| | | |
| | | <if test="order_id != null and order_id != ''"> |
| | | and order_id = #{order_id} |
| | | </if> |
| | | |
| | | <if test="process_id != null and process_id != ''"> |
| | | and process_id = #{process_id} |
| | | </if> |
| | | |
| | | <if test="project != null and project != ''"> |
| | | and project = #{project} |
| | | </if> |
| | | </where> |
| | | |
| | | order by id desc |
| | | limit #{pageNum},#{pageSize} |
| | | ; |
| | | </select> |
| | | |
| | | |
| | | <!--返工管理--> |
| | | <select id="reworkDataManage" resultMap="reworkManage"> |
| | | select * from v_rework |
| | | |
| | | |
| | | |
| | | order by id desc |
| | | limit #{pageNum},#{pageSize} |
| | | ; |
| | | </select> |
| | | |
| | | |
| | | <!--返工管理--> |
| | | <select id="reworkDataManage2" resultMap="reworkManage"> |
| | | select * from v_rework |
| | | |
| | | <where> |
| | | |
| | | /*create_time <![CDATA[>=]]> #{sDate} and create_time <![CDATA[<=]]> #{eDate}}*/ |
| | | /*大于等于,小于等于*/ |
| | | create_time >= #{sDate} and create_time <= #{eDate}} |
| | | |
| | | and rework_team is not null |
| | | |
| | | <if test="order_id != null and order_id != ''"> |
| | | and order_id = #{order_id} |
| | | </if> |
| | | |
| | | <if test="process_id != null and process_id != ''"> |
| | | and process_id = #{process_id} |
| | | </if> |
| | | |
| | | <if test="project != null and project != ''"> |
| | | and project = #{project} |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | |
| | | order by id desc |
| | | limit #{pageNum},#{pageSize} |
| | | ; |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!--查询detail明细--> |
| | | <select id="reportingWorkId"> |
| | | select * from reporting_work_detail |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | |
| | | <select id="selectInventory"> |
| | | select reporting_work_num |
| | | FROM sd.order_process_detail as opd |
| | | where opd.process_id = #{processId} |
| | | and opd.order_number = #{orderNumber} |
| | | and opd.technology_number = #{technologyNumber} |
| | | and opd.process = '包装' |
| | | </select> |
| | | <!--<where> |
| | | |
| | | create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}} |
| | | <!–返工编号–> |
| | | <if test="rework_id!=null and rework != ''"> |
| | | and rework_id = #{reworkId} |
| | | </if> |
| | | <!–流程卡号–> |
| | | <if test="process_id != null and process_id != ''"> |
| | | and process_id=#{processId} |
| | | </if> |
| | | <!–返工类型–> |
| | | <if test="rework_Type != null and rework_Type!=''"> |
| | | and rework_Type=#{rework_Type} |
| | | </if> |
| | | <!–返工原因–> |
| | | <if test="rework_Reason != null and rework_Reason!=''"> |
| | | and rework_Reason=#{rework_Reason} |
| | | </if> |
| | | <!–返工工序–> |
| | | <if test="rework_Processes != null and rework_Processes!=''"> |
| | | and rework_Processes=#{rework_Processes} |
| | | </if> |
| | | <!–返工数量–> |
| | | <if test="rework_Num != null and rework_Num!=''"> |
| | | and rework_Num=#{rework_Num} |
| | | </if> |
| | | <!–返工班组–> |
| | | <if test="rework_Team != null and rework_Team!=''"> |
| | | and rework_Team=#{rework_Team} |
| | | </if> |
| | | <!–审核人–> |
| | | <if test="reviewer != null and reviewer!=''"> |
| | | and reviewer=#{reviewer} |
| | | </if> |
| | | <!–审核状态–> |
| | | <if test="review_Status != null and review_Status!=''"> |
| | | and review_Status=#{review_Status} |
| | | </if> |
| | | <!–返工面积–> |
| | | <if test="rework_Area != null and rework_Area!=''"> |
| | | and rework_Area=#{rework_Area} |
| | | </if> |
| | | |
| | | </where>--> |
| | | |
| | | <!--获取返工新增数据--> |
| | | <!--<select id="getReworkAdd"> |
| | | SELECT `b`.`id` AS `id`, |
| | | `b`.`rework_team` AS `rework_team`, |
| | | `c`.`order_id` AS `order_id`, |
| | | `a`.`process_id` AS `process_id`, |
| | | `c`.`project` AS `project`, |
| | | `c`.`batch` AS `batch`, |
| | | `d`.`glass_child` AS `glass_child`, |
| | | `d`.`order_number` AS `order_Number`, |
| | | `d`.`technology_number` AS `technology_number`, |
| | | `d`.`glass_address` AS `glass_address`, |
| | | `b`.`breakage_number` AS `breakage_number`, |
| | | `d`.`child_width` AS `child_width`, |
| | | `d`.`child_height` AS `child_height`, |
| | | `e`.`shape` AS `shape`, |
| | | `b`.`return_process` AS `return_process`, |
| | | `b`.`breakage_reason` AS `breakage_reason`, |
| | | `b`.`responsible_equipment` AS `responsible_equipment`, |
| | | `b`.`responsible_team` AS `responsible_team`, |
| | | round((((`d`.`child_width` * `d`.`child_height`) * `b`.`breakage_number`) / 1000000), |
| | | 2) AS `rework_area`, |
| | | `b`.`qualityIns_pector` AS `qualityIns_pector` |
| | | FROM (((( |
| | | `reporting_work_detail` `b` |
| | | LEFT JOIN `reporting_work` `a` ON (( |
| | | `a`.`reporting_work_id` = `b`.`reporting_work_id` |
| | | ))) |
| | | LEFT JOIN `sd`.`order` `c` ON (( |
| | | `a`.`order_id` = `c`.`order_id` |
| | | ))) |
| | | LEFT JOIN `sd`.`order_detail` `e` ON ((( |
| | | `c`.`order_id` = `e`.`order_id` |
| | | ) |
| | | AND (`e`.`order_number` = `b`.`order_number`)))) |
| | | LEFT JOIN `sd`.`order_glass_detail` `d` ON ((( |
| | | `d`.`order_id` = `c`.`order_id` |
| | | ) |
| | | AND (`b`.`order_number` = `d`.`order_number`) |
| | | AND (`b`.`technology_number` = `d`.`technology_number`)))) |
| | | WHERE ( |
| | | `b`.`available` = 1) |
| | | </select>--> |
| | | |
| | | |
| | | |
| | | </mapper> |