DracStaffScrmWorkMapper.xml 2.38 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="cn.com.glsx.entmicro.mapper.DracStaffScrmWorkMapper">
    <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.DracStaffScrmWork">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="work_uid" jdbcType="VARCHAR" property="workUid"/>
        <result column="work_type" jdbcType="INTEGER" property="workType"/>
        <result column="customer_count" jdbcType="INTEGER" property="customerCount"/>
        <result column="task_status" jdbcType="INTEGER" property="taskStatus"/>
        <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
        <result column="merchant_id" jdbcType="INTEGER" property="merchantId"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
        <result column="oneId" jdbcType="TIMESTAMP" property="oneId"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
        -->
        id, work_code, work_type, customer_count, task_status, del_flag, merchant_id, created_by,
        created_time, updated_by, updated_time
    </sql>
    <select id="findWorkDetail"
            resultType="cn.com.glsx.entmicro.model.response.DracStaffScrmWorkCustomerReponse">
        select t4.user_id as userid,t3.task_status as status,t3.customer_Id as customerId,t3.customer_name as customerName,t3.customer_phone as customerPhone,t4.avatar
        ,t4.created_time as createdTime,t4.type as type,t4.one_id as oneId,t1.work_type as workType
        from
        drac_staff_scrm_work t1
        left join drac_staff_scrm_work_follow t2 on t1.id=t2.work_id
        left join drac_staff_scrm_work_customer t3 on t2.id=t3.work_relation_id
        left join scrm_customer t4 on t3.customer_id=t4.id
        where
        t1.work_uid=#{taskId}
        <if test="id!= null">
            and t2.staff_id=#{id}
        </if>
        <if test="status!= null">
            and t3.task_status=#{status}
        </if>
    </select>
</mapper>