Newer
Older
casic-metering-eqpt-xichang / casic-metering-dao / src / main / resources / mapper / plan / PlanNotifyMapper.xml
zhangyingjie on 22 Aug 2023 1 KB 修改任务单管理接口
<?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.plan.PlanNotifyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.casic.missiles.model.plan.PlanNotify">
        <id column="id" property="id" />
        <result column="notify_no" property="notifyNo" />
        <result column="notify_name" property="notifyName" />
        <result column="notify_type" property="notifyType" />
        <result column="notify_user" property="notifyUser" />
        <result column="notify_dept" property="notifyDept" />
        <result column="plan_id" property="planId" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, notify_no, notify_name, notify_type, notify_user, notify_dept, plan_id, create_time, update_time
    </sql>

    <select id="listPage" resultType="com.casic.missiles.model.plan.PlanNotify">
        SELECT
            n.id as id,
            n.notify_no as notifyNo,
            n.notify_name as notifyName,
            n.notify_type as notifyType,
            n.notify_user as notifyUser,
            n.notify_dept as notifyDept,
            n.plan_id as planId,
            p.plan_category as planCategory,
            p.create_user_id as createUserId,
            p.create_user_name as createUserName,
            p.create_dept_id as createDeptId,
            p.create_dept_name as createDeptName,
            p.create_time as createTime
        FROM
            eqpt_plan_notify n
        LEFT JOIN eqpt_plan p ON  n.plan_id = p.id
        <where>
            <if test="ew != null">
                ${ew.sqlSegment}
            </if>
        </where>
    </select>

</mapper>