浏览代码

抽检模块SQLMap文件

oyq28 3 年之前
父节点
当前提交
53bec90e18

+ 42 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/InspectionMapper.xml

@@ -0,0 +1,42 @@
+<?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.github.zuihou.business.operationManagementCenter.dao.InspectionMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.github.zuihou.business.operationManagementCenter.entity.Inspection">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="bom_id" jdbcType="BIGINT" property="bomId"/>
+        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
+        <result column="plan_id" jdbcType="BIGINT" property="planId"/>
+        <result column="zone_id" jdbcType="BIGINT" property="zoneId"/>
+        <result column="workpiece_id" jdbcType="BIGINT" property="workpieceId"/>
+        <result column="task_id" jdbcType="BIGINT" property="taskId"/>
+        <result column="create_user" jdbcType="VARCHAR" property="createUser"/>
+        <result column="result" jdbcType="INTEGER" property="result"/>
+        <result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
+        <result column="report" jdbcType="VARCHAR" property="report"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id,create_time,update_time,create_user, update_user, bom_id,zone_id,task_id,order_id,plan_id, workpiece_id, result,report,org_id,
+        bomName, partsNo, startTime, endTime,procedureNo, procedureName, zoneNo
+    </sql>
+
+    <!-- 分页 -->
+    <select id="pageList" parameterType="String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from (
+           select a.*, b.name as bomName, b.parts_no as partsNo, o.start_time as startTime, o.end_time as endTime, p.name as procedureName, p.no as procedureNo, z.org_id, z.no as zoneNo from imcs_o_order_inspection a
+           left join imcs_p_plan o on a.plan_id = o.id
+           left join imcs_b_bom b on a.bom_id = b.id
+           left join imcs_z_zone z on a.zone_id = z.id
+           left join imcs_t_task k on a.task_id = k.id
+           left join imcs_b_bom_procedure p on k.procedure_id = p.id
+        ) s ${ew.customSqlSegment}
+    </select>
+
+</mapper>