<?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.xhkjedu.sapi.mapper.itemtool.TodoMapper">
    <!-- 所有代办事项 -->
    <resultMap id="todoResult" type="com.xhkjedu.sapi.vo.itemtool.TodoVo">
        <result property="tododate" column="tododate"></result>
        <collection property="contents" ofType="com.xhkjedu.sapi.vo.itemtool.ContentVo">
            <result property="todoid" column="todoid"></result>
            <result property="content" column="content"></result>
            <result property="todotime" column="todotime"></result>
            <result property="todostate" column="todostate"></result>
        </collection>
    </resultMap>
    <select id="listAll" resultMap="todoResult">
        select RIGHT(t.tododate,2)tododate,t.todoid,t.content,t.todotime,t.todostate
        from t_todo t where t.userid=#{todo.userid} and t.tododate like '${todo.tododate}%'
        order by t.todostate,todotime
    </select>
    <!--代办事项完成-->
    <update id="finished">
        update t_todo set todostate=#{todostate} where todoid=#{todoid}
    </update>



</mapper>
