<?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.axzo.msg.center.dal.mapper.TodoMapper">

    <delete id="deleteByIds">
        delete from todo_business WHERE id in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </delete>

    <select id="getMigratedBusinessId" resultType="long">
        SELECT DISTINCT todo_business_id
        FROM todo
        WHERE biz_code != ''
          AND record_ext -> '$.isMigratedFromPendingMessage' = true
    </select>

    <select id="getTodoLatestUpdateTime" resultType="date">
        SELECT max(update_at) FROM todo WHERE executor_person_id = #{executorPersonId}
    </select>

</mapper>

