Newer
Older
huludao / src / main / resources / mapper / EventsManage / ComplaintProcessMapper.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.newfiber.api.pc.dao.EventsManage.ComplaintProcessMapper">

     <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.EventsManage.ComplaintProcess">
                    <result column="id"  property="id"/>
                    <result column="complaint_type"  property="complaintType"/>
                    <result column="complaint_task_id"  property="complaintTaskId"/>
                    <result column="operation_user_no"  property="operationUserNo"/>
                    <result column="next_user_no"  property="nextUserNo"/>
                    <result column="pic_no"  property="picNo"/>
                    <result column="description"  property="description"/>
                    <result column="state"  property="state"/>
                    <result column="state_desc"  property="stateDesc"/>
                    <result column="create_time"  property="createTime"/>
                    <result column="update_time"  property="updateTime"/>
            </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              id,
              complaint_type,
              complaint_task_id,
              operation_user_no,
              next_user_no,
              pic_no,
              description,
              state,
              state_desc,
              create_time,
              update_time
          </sql>

    <resultMap id="processDto" type="com.newfiber.api.pc.model.EventsManage.ComplaintProcessDto">
        <result column="id"  property="id"/>
        <result column="complaint_type"  property="complaintType"/>
        <result column="complaint_task_id"  property="complaintTaskId"/>
        <result column="operation_user_no"  property="operationUserNo"/>
        <result column="operationUserName"  property="operationUserName"/>
        <result column="next_user_no"  property="nextUserNo"/>
        <result column="pic_no"  property="picNo"/>
        <result column="description"  property="description"/>
        <result column="state"  property="state"/>
        <result column="state_desc"  property="stateDesc"/>
        <result column="cps_create_time"  property="createTime"/>
        <result column="update_time"  property="updateTime"/>
        <collection property="processPics" ofType="com.newfiber.api.pc.model.EventsManage.ComplainPic">
            <id column="Serial" property="serial" />
            <result column="Events_No" property="eventsNo" />
            <result column="Pic_Type" property="picType" />
            <result column="Pic_Type_Name" property="picTypeName" />
            <result column="Pic_Name" property="picName" />
            <result column="Pic_Path" property="picPath"/>
            <result column="cp_Create_Time" property="createTime" />
        </collection>
    </resultMap>

    <select id="selectListByTaskId" resultMap="processDto">
       SELECT
        cps.id,
        cps.complaint_type,
        cps.complaint_task_id,
        cps.operation_user_no,
        cps.next_user_no,
        cps.pic_no,
        cps.description,
        cps.state,
        cps.state_desc,
        cps.create_time as cps_create_time,
        cps.update_time,
        sui.user_name as operationUserName,
        cp.Serial,cp.Events_No,cp.Pic_Type,cp.Pic_Type_Name,cp.Pic_Name,cp.Pic_Path,cp.Create_Time as cp_Create_Time
       FROM `complaint_process` cps
       left join complain_pic cp on cps.pic_no = cp.Events_No
       left join huludao_main.sys_user_info sui on cps.operation_user_no = sui.user_no
       where cps.complaint_task_id = #{taskId} order by cps.create_time,cps.id desc
    </select>

</mapper>