Newer
Older
casic-metering-biz-xichang / casic-metering-dao / src / main / resources / mapper / quality / BizQualityNonConformanceRepMapper.xml
liwenhao on 17 Jan 2024 5 KB 1.质量审批权限调整
<?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.casic.missiles.mapper.quality.BizQualityNonConformanceRepMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityNonConformanceRep">
        <result column="id" property="id"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="biz_lab_code" property="bizLabCode"/>
        <result column="dept_id" property="deptId"/>
        <result column="sys_code" property="sysCode"/>
        <result column="file_code" property="fileCode"/>
        <result column="file_name" property="fileName"/>
        <result column="creator" property="creator"/>
        <result column="approval_status" property="approvalStatus"/>
        <result column="process_id" property="processId"/>
        <result column="super_record_id" property="superRecordId"/>
        <result column="problem" property="problem"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        ,
            create_time as createTime ,
            update_time as updateTime ,
            biz_lab_code as bizLabCode ,
            dept_id as deptId ,
            sys_code as sysCode ,
            file_code as fileCode ,
            file_name as fileName ,
            creator ,
            approval_status as approvalStatus ,
            process_id as processId ,
            super_record_id as superRecordId ,
            problem,a.sub_time as subTime,a.group_no as groupNo,a.log_time as logTime
    </sql>

    <select id="selectBizQualityNonConformanceRepPage"
            resultType="com.casic.missiles.model.quality.BizQualityNonConformanceRep">
        select
        a.id ,
        a.create_time as createTime ,
        a.update_time as updateTime ,
        a.biz_lab_code as bizLabCode ,
        a.dept_id as deptId ,
        a.sys_code as sysCode ,
        a.file_code as fileCode ,
        a.file_name as fileName ,
        a.creator ,
        a.approval_status as approvalStatus ,
        a.process_id as processId ,
        a.super_record_id as superRecordId ,
        a.problem,a.sub_time as subTime,a.group_no as groupNo,a.log_time as logTime,a.creator_name as creatorName
        from biz_quality_non_conformance_rep a
        <where>
            <if test="ew != null">
                ${ew.sqlSegment}
            </if>
        </where>
        order by a.create_time desc
    </select>
<!--    <select id="selectMaxNo" resultType="java.lang.Long">-->
<!--        SELECT IFNULL(max(RIGHT(file_code, 3)), 0) from biz_quality_non_conformance_rep-->
<!--        <where>-->
<!--            <if test="ew != null">-->
<!--                ${ew.sqlSegment}-->
<!--            </if>-->
<!--        </where>-->
<!--    </select>-->
    <select id="selectBatchForApprovalList" resultType="com.casic.missiles.model.quality.BizQualityNonConformanceRep">
        select
        a.id ,
        a.create_time as createTime ,
        a.update_time as updateTime ,
        a.biz_lab_code as bizLabCode ,
        a.dept_id as deptId ,
        a.sys_code as sysCode ,
        a.file_code as fileCode ,
        a.file_name as fileName ,
        a.creator ,
        a.approval_status as approvalStatus ,
        a.process_id as processId ,
        a.super_record_id as superRecordId ,
        a.problem,a.sub_time as subTime,a.group_no as groupNo,a.log_time as logTime,a.creator_name as creatorName
        from biz_quality_non_conformance_rep a
        <where>
            <include refid="Base_Column_Query"/>
        </where>
        order by a.create_time desc
    </select>

    <sql id="Base_Column_Query">
        <if test="request!=null">

            <if test="request.bizLabCode!= null and request.bizLabCode!=''">
                and biz_lab_code = #{request.bizLabCode}
            </if>
            <if test="request.deptId!= null and request.deptId!=''">
                and dept_id = #{request.deptId}
            </if>
            <if test="request.subTimeStart!= null and request.subTimeStart !=''">
                and sub_time >= #{request.subTimeStart}
            </if>
            <if test="request.subTimeEnd!= null and request.subTimeEnd !=''">
                and sub_time  <![CDATA[ <= ]]> #{request.subTimeEnd}
            </if>
            <if test="request.groupNo!= null and request.groupNo!=''">
                and group_no = #{request.groupNo}
            </if>
            <if test="request.creator!= null and request.creator!=''">
                and creator = #{request.creator}
            </if>
            <if test="request != null and request.createUserId != null and request.createUserId !=''">
                and creator = #{request.createUserId}
            </if>
            <if test="request != null and request.approvalStatus != null and request.approvalStatus !=''">
                and approval_status = #{request.approvalStatus}
            </if>
            <if test="businessKeys != null">
                and id in
                <foreach collection="businessKeys" item="id" index="index" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </if>
        </if>
    </sql>
</mapper>