<?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.diagbot.mapper.ModuleDetailMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.ModuleDetail">
        <id column="id" property="id" />
        <result column="is_deleted" property="isDeleted" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_modified" property="gmtModified" />
        <result column="creator" property="creator" />
        <result column="modifier" property="modifier" />
        <result column="module_id" property="moduleId" />
        <result column="prefix" property="prefix" />
        <result column="suffix" property="suffix" />
        <result column="question_id" property="questionId" />
        <result column="order_no" property="orderNo" />
        <result column="remark" property="remark" />
    </resultMap>

    <delete id="deleteByQuestionIds" parameterType="java.util.Map">
        update `icss_module_detail`
        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
        where is_deleted = 'N'
        and question_id in
        <foreach item="id" collection="ids" open="(" separator="," close=")" >
            #{id}
        </foreach>
    </delete>


    <delete id="deleteByModuleIds" parameterType="java.util.Map">
        update `icss_module_detail`
        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
        where is_deleted = 'N'
        and module_id in
        <foreach item="id" collection="ids" open="(" separator="," close=")" >
            #{id}
        </foreach>
    </delete>
</mapper>
