<?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.gkhy.safePlatform.specialWork.repository.WorkMaterialCheckRepository">
|
|
<resultMap type="com.gkhy.safePlatform.specialWork.entity.WorkMaterialCheckInfo" id="MaterialCheckMap">
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
<result property="materialName" column="material_name" jdbcType="VARCHAR"/>
|
<result property="configurationLevel" column="configuration_level" jdbcType="TINYINT"/>
|
<result property="useCount" column="use_count" jdbcType="INTEGER"/>
|
<result property="sceneCount" column="scene_count" jdbcType="INTEGER"/>
|
<result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/>
|
<result property="wpcId" column="wpc_id" jdbcType="BIGINT"/>
|
</resultMap>
|
|
|
|
<!--查询数据-->
|
<select id="getListByWpcIds" resultMap="MaterialCheckMap">
|
select id, material_name, configuration_level, use_count, scene_count, work_apply_id, wpc_id
|
from work_material_check
|
where wpc_id in
|
<foreach collection="wpcIds" item="wpcId" open="(" close=")" separator=",">
|
#{wpcId}
|
</foreach>
|
</select>
|
|
<!--新增所有列-->
|
<insert id="insertOne" >
|
insert into material_detail(id, material_name, configuration_level, use_count, scene_count, work_apply_id, wpc_id)
|
values (#{id},#{materialName}, #{configurationLevel}, #{useCount}, #{sceneCount}, #{workApplyId}, #{wpcId})
|
</insert>
|
|
<!--批量插入-->
|
<insert id="saveMaterialCheckBatch" >
|
insert into material_detail(id, material_name, configuration_level, use_count, scene_count, work_apply_id, wpc_id)
|
values
|
<foreach collection="entities" item="entity" separator=",">
|
(#{entity.id},#{entity.materialName}, #{entity.configurationLevel}, #{entity.useCount}, #{entity.sceneCount}, #{entity.workApplyId}, #{entity.wpcId})
|
</foreach>
|
</insert>
|
|
</mapper>
|