<?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.vote.system.mapper.VoteSubmissionMapper">

    <resultMap id="BaseResultMap" type="com.vote.system.domain.VoteSubmission">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="eventId" column="event_id" jdbcType="BIGINT"/>
        <result property="roundId" column="round_id" jdbcType="BIGINT"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="workSettingsId" column="work_settings_id" jdbcType="BIGINT"/>
        <result property="commitName" column="commit_name" jdbcType="VARCHAR"/>
        <result property="locationId" column="location_id" jdbcType="BIGINT"/>
        <result property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="createType" column="create_type" jdbcType="VARCHAR"/>
        <result property="mainAuthor" column="main_author" jdbcType="VARCHAR"/>
        <result property="teamWorker" column="team_worker" jdbcType="VARCHAR"/>
        <result property="ageSegment" column="age_segment" jdbcType="VARCHAR"/>
        <result property="file" column="file" jdbcType="VARCHAR"/>
        <result property="video" column="video" jdbcType="VARCHAR"/>
        <result property="images" column="images" jdbcType="VARCHAR"/>
        <result property="phone" column="phone" jdbcType="VARCHAR"/>
        <result property="promoteStatus" column="promote_status" jdbcType="VARCHAR"/>
        <result property="promoteTime" column="promote_time" jdbcType="TIMESTAMP"/>
        <result property="award" column="award" jdbcType="VARCHAR"/>
        <result property="status" column="status" jdbcType="CHAR"/>
        <result property="appraiseStatus" column="appraise_status" jdbcType="CHAR"/>
        <result property="remarks" column="status" jdbcType="VARCHAR"/>
        <result property="isDeleted" column="is_deleted" jdbcType="CHAR"/>
        <result property="createById" column="create_by_id" jdbcType="BIGINT"/>
        <result property="createAt" column="create_at" jdbcType="TIMESTAMP"/>
        <result property="updateById" column="update_by_id" jdbcType="BIGINT"/>
        <result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/>
        <result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
    </resultMap>

    <sql id="Base_Column_List">
        id
        ,name,work_tyoe_id,
        commit_name,location_id,phone,
        status,is_deleted,create_by_id,
        create_at,update_by_id,update_at,
        tenant_id
    </sql>

    <update id="updateBatch">
        UPDATE vote_submission
        SET appraise_status = '1', update_at = NOW()
        WHERE id IN
        <foreach item="id" collection="submissionIds" open="(" separator="," close=")">
            #{id}
        </foreach>

    </update>
</mapper>
