<?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.ruoyi.web.modules.industryservice.mapper.BizYakPenRelMapper">
    <resultMap type="com.ruoyi.web.modules.industryservice.domain.BizYakPenRel" id="BizYakPenRelResult">
        <id property="id" column="id"/>
        <result property="yakAssetId" column="yak_asset_id"/>
        <result property="penName" column="pen_name"/>
    </resultMap>
    <select id="selectByYakAssetId" resultMap="BizYakPenRelResult">
        select id, yak_asset_id, pen_name from biz_yak_pen_rel where yak_asset_id = #{yakAssetId} order by id desc
    </select>
    <delete id="deleteByYakAssetId">delete from biz_yak_pen_rel where yak_asset_id = #{yakAssetId}</delete>
    <insert id="batchInsert">
        insert into biz_yak_pen_rel (yak_asset_id, pen_name) values
        <foreach collection="list" item="item" separator=",">(#{item.yakAssetId}, #{item.penName})</foreach>
    </insert>
</mapper>
