162 lines
9.0 KiB
XML
162 lines
9.0 KiB
XML
<?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.mhd.wms.domain.investigationManage.repository.mapper.InvestigationManageMapper">
|
|
|
|
<resultMap type="com.mhd.wms.domain.investigationManage.repository.po.InvestigationManagePO" id="InvestigationManageResult">
|
|
<result property="investigationManageId" column="investigation_manage_id" />
|
|
<result property="organizationId" column="organization_id" />
|
|
<result property="organizationName" column="organization_name" />
|
|
<result property="topOrganizationId" column="top_organization_id" />
|
|
<result property="investigationNumber" column="investigation_number" />
|
|
<result property="oldInvestigationNumber" column="old_investigation_number" />
|
|
<result property="investigationStatus" column="investigation_status" />
|
|
<result property="investigationRange" column="investigation_range" />
|
|
<result property="investigationType" column="investigation_type" />
|
|
<result property="investigationMethod" column="investigation_method" />
|
|
<result property="investigationFrequency" column="investigation_frequency" />
|
|
<result property="differentNumber" column="different_number" />
|
|
<result property="warehouseId" column="warehouse_id" />
|
|
<result property="warehouseCode" column="warehouse_code" />
|
|
<result property="warehouseName" column="warehouse_name" />
|
|
<result property="auditStatus" column="audit_status" />
|
|
<result property="auditRemark" column="audit_remark" />
|
|
<result property="auditBy" column="audit_by" />
|
|
<result property="auditByName" column="audit_by_name" />
|
|
<result property="auditTime" column="audit_time" />
|
|
<result property="taskDistribution" column="task_distribution" />
|
|
<result property="taskDistributionTime" column="task_distribution_time" />
|
|
<result property="operatorsBy" column="operators_by" />
|
|
<result property="operatorsName" column="operators_name" />
|
|
<result property="investigationManBy" column="investigation_man_by" />
|
|
<result property="investigationManName" column="investigation_man_name" />
|
|
<result property="nullify" column="nullify" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createByName" column="create_by_name" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateByName" column="update_by_name" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="totalInventoryQuantity" column="total_inventory_quantity" />
|
|
<result property="investigatedInventoryQuantity" column="investigated_inventory_quantity" />
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectInvestigationManagePo">
|
|
select m.investigation_manage_id, m.organization_id, m.organization_name, m.top_organization_id, m.investigation_number, m.old_investigation_number, m.investigation_status, m.investigation_range, m.investigation_type, m.investigation_method, m.investigation_frequency, m.different_number, m.warehouse_id, m.warehouse_code, m.warehouse_name, m.audit_status, m.audit_remark, m.audit_by, m.audit_by_name, m.audit_time, m.task_distribution, m.task_distribution_time, m.operators_by, m.operators_name, m.investigation_man_by, m.investigation_man_name, m.nullify, m.remark, m.create_time, m.create_by, m.create_by_name, m.update_time, m.update_by, m.update_by_name, m.del_flag,
|
|
(SELECT IFNULL(SUM(d.inventory_quantity), 0) FROM investigetion_manage_detail d WHERE d.investigation_number = m.investigation_number AND d.del_flag = 1) as total_inventory_quantity,
|
|
(SELECT IFNULL(SUM(d.inventory_quantity), 0) FROM investigetion_manage_detail d WHERE d.investigation_number = m.investigation_number AND d.del_flag = 1 AND d.investigation_status IN (3, 4)) as investigated_inventory_quantity
|
|
from investigation_manage m
|
|
</sql>
|
|
|
|
<sql id="selectInvestigationManagePo1">
|
|
<where>
|
|
and m.del_flag = 1
|
|
<if test="organizationId != null ">
|
|
and m.organization_id = #{organizationId}
|
|
</if>
|
|
<if test="organizationName != null and organizationName != ''">
|
|
and m.organization_name like concat('%', #{organizationName}, '%')
|
|
</if>
|
|
<if test="topOrganizationId != null ">
|
|
and m.top_organization_id = #{topOrganizationId}
|
|
</if>
|
|
<if test="investigationNumber != null and investigationNumber != ''">
|
|
and m.investigation_number like concat('%',#{investigationNumber},'%')
|
|
</if><if test="oldInvestigationNumber != null and oldInvestigationNumber != ''">
|
|
and m.old_investigation_number = concat('%',#{oldInvestigationNumber},'%')
|
|
</if>
|
|
<if test="investigationStatus != null ">
|
|
and m.investigation_status = #{investigationStatus}
|
|
</if>
|
|
<if test="investigationRange != null and investigationRange != ''">
|
|
and m.investigation_range = #{investigationRange}
|
|
</if>
|
|
<if test="investigationType != null ">
|
|
and m.investigation_type = #{investigationType}
|
|
</if>
|
|
<if test="investigationMethod != null ">
|
|
and m.investigation_method = #{investigationMethod}
|
|
</if>
|
|
<if test="investigationFrequency != null ">
|
|
and m.investigation_frequency = #{investigationFrequency}
|
|
</if>
|
|
<if test="differentNumber != null and differentNumber != ''">
|
|
and m.different_number = #{differentNumber}
|
|
</if>
|
|
<if test="warehouseId != null ">
|
|
and m.warehouse_id = #{warehouseId}
|
|
</if>
|
|
<if test="warehouseCode != null and warehouseCode != ''">
|
|
and m.warehouse_code = #{warehouseCode}
|
|
</if>
|
|
<if test="warehouseName != null and warehouseName != ''">
|
|
and m.warehouse_name like concat('%', #{warehouseName}, '%')
|
|
</if>
|
|
<if test="auditStatus != null ">
|
|
and m.audit_status = #{auditStatus}
|
|
</if>
|
|
<if test="auditRemark != null and auditRemark != ''">
|
|
and m.audit_remark = #{auditRemark}
|
|
</if>
|
|
<if test="auditBy != null ">
|
|
and m.audit_by = #{auditBy}
|
|
</if>
|
|
<if test="auditByName != null and auditByName != ''">
|
|
and m.audit_by_name like concat('%', #{auditByName}, '%')
|
|
</if>
|
|
<if test="auditTime != null ">
|
|
and m.audit_time = #{auditTime}
|
|
</if>
|
|
<if test="taskDistribution != null ">
|
|
and m.task_distribution = #{taskDistribution}
|
|
</if>
|
|
<if test="taskDistributionTime != null ">
|
|
and m.task_distribution_time = #{taskDistributionTime}
|
|
</if>
|
|
<if test="operatorsBy != null ">
|
|
and m.operators_by = #{operatorsBy}
|
|
</if>
|
|
<if test="operatorsName != null and operatorsName != ''">
|
|
and m.operators_name like concat('%', #{operatorsName}, '%')
|
|
</if>
|
|
<if test="nullify != null ">
|
|
and m.nullify = #{nullify}
|
|
</if>
|
|
<if test="createByName != null and createByName != ''">
|
|
and m.create_by_name like concat('%', #{createByName}, '%')
|
|
</if>
|
|
<if test="updateByName != null and updateByName != ''">
|
|
and m.update_by_name like concat('%', #{updateByName}, '%')
|
|
</if>
|
|
<if test="createStartTime != null">
|
|
and date_format(m.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[>=]]> #{createStartTime}
|
|
</if>
|
|
<if test="createEndTime != null">
|
|
and date_format(m.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[<=]]> #{createEndTime}
|
|
</if>
|
|
<if test="remark != null and remark != ''">
|
|
and m.remark like concat('%',#{remark},'%')
|
|
</if>
|
|
<if test="investigationManageIds != null and investigationManageIds.size > 0 ">
|
|
and m.investigation_manage_id in
|
|
<foreach collection="investigationManageIds" item="item" index="index" open="(" close=")" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<choose>
|
|
<when test="delFlag != null"> and m.del_flag = #{delFlag} </when>
|
|
<otherwise> and m.del_flag = 1 </otherwise>
|
|
</choose>
|
|
</where>
|
|
</sql>
|
|
|
|
<select id="queryList" parameterType="com.mhd.wms.domain.investigationManage.repository.todo.InvestigationManageDO" resultMap="InvestigationManageResult">
|
|
<include refid="selectInvestigationManagePo"/>
|
|
<include refid="selectInvestigationManagePo1"/>
|
|
order by m.create_time desc
|
|
</select>
|
|
</mapper> |