Newer
Older
casic-metering-biz-xichang / casic-metering-dao / src / main / resources / mapper / quality / BizQualityManagementReviewRepMapper.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.BizQualityManagementReviewRepMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityManagementReviewRep">
        <result column="id" property="id"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="year_time" property="yearTime"/>
        <result column="biz_lab_code" property="bizLabCode"/>
        <result column="year_num" property="yearNum"/>
        <result column="commander_id" property="commanderId"/>
        <result column="commander_name" property="commanderName"/>
        <result column="year_no" property="yearNo"/>
        <result column="file_name" property="fileName"/>
        <result column="file_code" property="fileCode"/>
        <result column="sys_code" property="sysCode"/>
        <result column="content" property="content"/>
        <result column="review_time" property="reviewTime"/>
        <result column="meeting_situation" property="meetingSituation"/>
        <result column="review_decision" property="reviewDecision"/>
        <result column="tracking_situation" property="trackingSituation"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        ,
         create_time as createTime ,
         update_time as updateTime ,
                    year_time as yearTime ,
                    biz_lab_code as bizLabCode ,
                    year_num as yearNum ,
                    commander_id as commanderId ,
                    commander_name as commanderName ,
                    year_no as yearNo ,
                    file_name as fileName ,
                    file_code as fileCode ,
                    sys_code as sysCode ,
            content ,
                review_time as reviewTime ,
                meeting_situation as meetingSituation ,
                review_decision as reviewDecision ,
                tracking_situation as trackingSituation,
                approval_status as approvalStatus,
                process_id as processId,creator,creator_name as creatorName
,review_file_name as reviewFileName,review_file_path as reviewFilePath
    </sql>
    <sql id="Base_Column_Alias">
        a
        .
        id
        ,
                a.create_time as createTime ,
                a.update_time as updateTime ,
                a.year_time as yearTime ,
                a.biz_lab_code as bizLabCode ,
                a.year_num as yearNum ,
                a.commander_id as commanderId ,
                a.commander_name as commanderName ,
                a.year_no as yearNo ,
                a.file_name as fileName ,
                a.file_code as fileCode ,
                a.sys_code as sysCode ,
                a.content ,
                a.review_time as reviewTime ,
                a.meeting_situation as meetingSituation ,
                a.review_decision as reviewDecision ,
                a.tracking_situation as trackingSituation,
                a.approval_status as approvalStatus,
                a.process_id as processId,a.creator,a.creator_name as creatorName
,a.review_file_name as reviewFileName,a.review_file_path as reviewFilePath
    </sql>
    <select id="selectBizQualityManagementReviewRepPage"
            resultType="com.casic.missiles.model.quality.BizQualityManagementReviewRep">
        select
        <include refid="Base_Column_Alias"/>
        from biz_quality_management_review_rep a
        <where>
            <if test="ew != null">
                ${ew.sqlSegment}
            </if>
        </where>
        order by a.create_time desc
    </select>
    <sql id="Base_Column_Query">
        <if test="request!=null">
            <if test="request.createTimeStart!= null and request.createTimeStart !=''">
                and create_time >= #{request.createTimeStart}
            </if>
            <if test="request.createTimeEnd!= null and request.createTimeEnd !=''">
                and create_time&lt;= #{request.createTimeEnd}
            </if>
            <if test="request.bizLabCode!= null and request.bizLabCode!=''">
                and biz_lab_code = #{request.bizLabCode}
            </if>
            <if test="request != null and request.createUserId != null and request.createUserId !=''">
                and commander_id = #{request.createUserId}
            </if>
            <if test="request.commanderId!= null and request.commanderId!=''">
                and commander_id = #{request.commanderId}
            </if>
            <if test="request.commanderName!= null and request.commanderName!=''">
                and commander_name like concat('%',#{request.commanderName},'%')
            </if>
            <if test="request.fileName!= null and request.fileName!=''">
                and file_name like concat('%',#{request.fileName},'%')
            </if>
            <if test="request.fileCode!= null and request.fileCode!=''">
                and file_code like concat('%',#{request.fileCode},'%')
            </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>

    <select id="selectBatchForApprovalList" resultType="com.casic.missiles.model.quality.BizQualityManagementReviewRep">
        select
        <include refid="Base_Column_Alias"/>
        from biz_quality_management_review_rep a
        WHERE 1=1
        <include refid="Base_Column_Query"/>
        ORDER BY a.create_time DESC
    </select>
</mapper>