<?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.xueyi.system.digitalmans.mapper.DmSkillMapper">

    <resultMap type="DmSkillPo" id="DmSkillResult">
        <result property="id"      column="id"       />
        <result property="manId"      column="man_id"       />
        <result property="skillCode"      column="skill_code"       />
        <result property="info"      column="info"       />
        <result property="resp"      column="resp"       />
        <result property="motionId"      column="motion_id"       />
        <result property="motionName"      column="motion_name"       />
        <result property="delFlag"      column="del_flag"       />
        <result property="firstCall"      column="first_call"       />
        <result property="status"      column="status"       />
    </resultMap>



    <select id="selectSkillListByH5" parameterType="DmSyncDigitalmanVo" resultMap="DmSkillResult">
        select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name from dm_skills s
        where (UNIX_TIMESTAMP(s.update_time) * 1000 > #{timestamp} or UNIX_TIMESTAMP(s.create_time) * 1000 > #{timestamp} ) and man_id = #{manId}
    </select>

    <select id="selectSkillByCode" parameterType="String" resultMap="DmSkillResult">
        select s.id, s.man_id,s.status, s.first_call, s.skill_code, s.info, s.del_flag, s.resp, s.motion_id, s.motion_name, s.auth from dm_skills s
        where s.skill_code = #{skillCode} limit 1
    </select>
</mapper>