package com.gree.mall.manager.commonmapper;

import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

public interface UnbindUserServiceMapper {
    @Select("<script>" +
            "UPDATE `user` " +
            "SET service_id = NULL," +
            "service_time = NULL " +
            "WHERE " +
            "user_id IN (" +
            "SELECT " +
            "user_id " +
            "FROM " +
            "(" +
            "SELECT user_id FROM `user` WHERE service_time <![CDATA[<]]> DATE_SUB(CURDATE(), INTERVAL 29 DAY)) temp_res" +
            ")" +
            "</script>")
    @ResultType(java.lang.Integer.class)
    Integer unbind();
}
