Newer
Older
casic-metering-biz-xichang / casic-metering-dao / src / main / resources / mapper / quality / BizQualityReviewFormMapper.xml
liwenhao on 11 Feb 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.BizQualityReviewFormMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityReviewForm">
        <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="sys_code" property="sysCode"/>
        <result column="file_code" property="fileCode"/>
        <result column="file_name" property="fileName"/>
        <result column="creator" property="creator"/>
        <result column="creator_name" property="creatorName"/>
        <result column="year_no" property="yearNo"/>
        <result column="log_time" property="logTime"/>
        <result column="approval_status" property="approvalStatus"/>
        <result column="process_id" property="processId"/>
        <result column="dept_id" property="deptId"/>
    </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 ,
                    sys_code as sysCode ,
                    file_code as fileCode ,
                    file_name as fileName ,
            creator ,
                    creator_name as creatorName ,
                    year_no as yearNo ,
                    log_time as logTime ,
                    approval_status as approvalStatus ,
                    process_id as processId ,
                    dept_id as deptId
    </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.sys_code as sysCode ,
                a.file_code as fileCode ,
                a.file_name as fileName ,
                a.creator ,
                a.creator_name as creatorName ,
                a.year_no as yearNo ,
                a.log_time as logTime ,
                a.approval_status as approvalStatus ,
                a.process_id as processId ,
                a.dept_id as deptId,
                a.dept_manager_id as deptManagerId,
                a.dept_manager_name as deptManagerName
    </sql>
    <select id="selectBizQualityReviewFormPage" resultType="com.casic.missiles.model.quality.BizQualityReviewForm">
        select
        <include refid="Base_Column_Alias"/>
        from biz_quality_review_form a
        <where>
            <if test="ew != null">
                ${ew.sqlSegment}
            </if>
        </where>
    </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.fileCode!= null and request.fileCode!=''">
                and file_code  like concat('%',#{request.fileCode},'%')
            </if>
            <if test="request.fileName!= null and request.fileName!=''">
                and file_name like concat('%',#{request.fileName},'%')
            </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.creatorName!= null and request.creatorName!=''">
                and creator_name like concat('%',#{request.creatorName},'%')
            </if>
            <if test="request.deptId!= null and request.deptId!=''">
                and dept_id = #{request.deptId}
            </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.BizQualityReviewForm">
        select
        <include refid="Base_Column_Alias"/>
        from biz_quality_review_form a
        WHERE 1=1
        <include refid="Base_Column_Query"/>
        ORDER BY a.year_time DESC,a.year_num DESC,a.create_time DESC
    </select>
</mapper>