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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.missiles.model.quality.BizQualityManagementOperationRep">
        <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="management_review_id" property="managementReviewId"/>
        <result column="file_name" property="fileName"/>
        <result column="file_code" property="fileCode"/>
        <result column="dept_id" property="deptId"/>
        <result column="sys_code" property="sysCode"/>
    </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 ,
                    management_review_id as managementReviewId ,
                    file_name as fileName ,
                    file_code as fileCode ,
                    dept_id as deptId ,
                    sys_code as sysCode,
        remarks
    </sql>

    <select id="selectBizQualityManagementOperationRepPage"
            resultType="com.casic.missiles.model.quality.BizQualityManagementOperationRep">
        select
        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.management_review_id as managementReviewId ,
        a.file_name as fileName ,
        a.file_code as fileCode ,
        a.dept_id as deptId ,
        a.sys_code as sysCode,
        a.remarks
        from biz_quality_management_operation_rep a
        <where>
            <if test="ew != null">
                ${ew.sqlSegment}
            </if>
        </where>
        order by a.year_time desc,a.year_num desc, 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.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.deptId!= null and request.deptId!=''">
                and dept_id = #{request.deptId}
            </if>
        </if>
    </sql>
</mapper>