AiSparringStaffInfoMapper.xml 2.7 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.dj.mindworkplate.mapper.AiSparringStaffInfoMapper" >
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.AiSparringStaffInfo" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="staff_uuid" property="staffUuid" jdbcType="VARCHAR" />
    <result column="staff_name" property="staffName" jdbcType="VARCHAR" />
    <result column="staff_phone" property="staffPhone" jdbcType="VARCHAR" />
    <result column="try_count" property="tryCount" jdbcType="TINYINT" />
    <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
    <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
    <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
    <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
    <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="DTOResultMap" extends="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.dto.AiSparringTaskStaffInfoDTO" >
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    id, staff_uuid, staff_name, staff_phone, try_count, deleted_flag, created_by, created_date, 
    updated_by, updated_date
  </sql>
  <sql id="Prefix_Column" >
    ${prefix}.id as ${prefix}_id,
    ${prefix}.staff_uuid as ${prefix}_staff_uuid,
    ${prefix}.staff_name as ${prefix}_staff_name,
    ${prefix}.staff_phone as ${prefix}_staff_phone,
    ${prefix}.try_count as ${prefix}_try_count,
    ${prefix}.deleted_flag as ${prefix}_deleted_flag,
    ${prefix}.created_by as ${prefix}_created_by,
    ${prefix}.created_date as ${prefix}_created_date,
    ${prefix}.updated_by as ${prefix}_updated_by,
    ${prefix}.updated_date as ${prefix}_updated_date
  </sql>

  <select id="findByStaffUuid" resultMap="BaseResultMap">
    select t.* from ai_sparring_staff_info t
    left join ai_sparring_task_staff_ref astsr on t.staff_uuid = astsr.staff_uuid and astsr.deleted_flag = 'N'
    where t.deleted_flag = 'N' and t.staff_uuid = #{staffUuid}
    <if test="yqMerchantId != null">
      and astsr.yq_merchant_id = #{yqMerchantId}
    </if>
    order by t.try_count, t.created_date desc
    limit 1
  </select>

  <select id="findByStaffUuids" resultMap="BaseResultMap">
    select t.* from ai_sparring_staff_info t
    where t.deleted_flag = 'N'
    and t.staff_uuid in
    <foreach collection="staffUuids" item="uuid" separator="," open="(" close=")" >
        #{uuid}
    </foreach>
  </select>
</mapper>