<?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="org.dromara.system.mapper.info.InfoPingLunMapper">

    <insert id="batchInfoPingLun">
        insert into info_pinglun( info_pinglun_id, info_id, info_pinglun_parent, info_pinglun_content, avatar, info_pinglun_user_id, info_pinglun_user_name, info_pinglun_quilt_user_id, info_pinglun_quilt_user_name, pinglun_time, info_pinglun_type, info_pinglun_examine, create_by, create_time, update_by, update_time, remark) values
        <foreach item="item" index="index" collection="list" separator=",">
            ( #{item.infoPingLunId}, #{item.infoId}, #{item.infoPingLunParent}, #{item.infoPingLunContent}, #{item.avatar}, #{item.infoPingLunUserId}, #{item.infoPingLunUserName}, #{item.infoPingLunQuiltUserId}, #{item.infoPingLunQuiltUserName}, #{item.pingLunTime}, #{item.infoPingLunType}, #{item.infoPingLunExamine}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
        </foreach>
    </insert>
    <delete id="deletePingLun" >
        delete from info_pinglun where
        <if test="infoPingLunType != null and infoPingLunType == 1">info_ping_lun_parent = #{infoPingLunId} or info_pinglun_id = #{infoPingLunId}</if>
        <if test="infoPingLunType != null and infoPingLunType == 2">info_pinglun_id = #{infoPingLunId}</if>
    </delete>
</mapper>
