<?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.WorkMaterialInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.specialWork.entity.WorkMaterialInfo" id="WorkMaterialMap">
|
<result property="id" column="id" jdbcType="BIGINT"/>
|
<result property="materialName" column="material_name" jdbcType="VARCHAR"/>
|
<result property="consumable" column="consumable" jdbcType="INTEGER"/>
|
<result property="standVal" column="stand_val" jdbcType="INTEGER"/>
|
<result property="configurationLevel" column="configuration_level" jdbcType="TINYINT"/>
|
<result property="maBaseId" column="ma_base_id" jdbcType="BIGINT"/>
|
<result property="smallClassifyId" column="small_classify_id" jdbcType="BIGINT"/>
|
<result property="bigClassifyId" column="big_classify_id" jdbcType="BIGINT"/>
|
<result property="bigClassifyName" column="big_classify_name" jdbcType="VARCHAR"/>
|
<result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/>
|
<result property="useCount" column="use_count" jdbcType="INTEGER"/>
|
<result property="depId" column="dep_id" jdbcType="BIGINT"/>
|
<result property="depName" column="dep_name" jdbcType="VARCHAR"/>
|
<result property="mdId" column="md_id" jdbcType="BIGINT"/>
|
<result property="receiveUids" column="receive_uids" jdbcType="VARCHAR"/>
|
<result property="receiveUnames" column="receive_unames" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<!--查询单个-->
|
<select id="queryById" resultMap="WorkMaterialMap">
|
select
|
id, material_name, consumable, stand_val, configuration_level, ma_base_id, big_classify_id, small_classify_id, big_classify_name, work_apply_id,use_count,dep_id,dep_name,md_id,receive_uids,receive_unames
|
from work_material
|
where id = #{id}
|
</select>
|
|
<!--查询指定行数据-->
|
<select id="listByCondition" resultMap="WorkMaterialMap">
|
select
|
id, material_name, consumable, stand_val, configuration_level, ma_base_id, big_classify_id, small_classify_id, big_classify_name,work_apply_id,use_count,dep_id,dep_name,md_id,receive_uids,receive_unames
|
from work_material
|
<where>
|
<if test="id != null">
|
and id = #{id}
|
</if>
|
<if test="materialName != null and materialName != ''">
|
and material_name = #{materialName}
|
</if>
|
<if test="standVal != null">
|
and stand_val = #{standVal}
|
</if>
|
<if test="configurationLevel != null">
|
and configuration_level = #{configurationLevel}
|
</if>
|
<if test="maBaseId != null">
|
and ma_base_id = #{maBaseId}
|
</if>
|
<if test="bigClassifyId != null">
|
and big_classify_id = #{bigClassifyId}
|
</if>
|
<if test="bigClassifyName != null and bigClassifyName != ''">
|
and big_classify_name = #{bigClassifyName}
|
</if>
|
<if test="smallClassifyId != null">
|
and small_classify_id = #{smallClassifyId}
|
</if>
|
<if test="workApplyId != null">
|
and work_apply_id = #{workApplyId}
|
</if>
|
|
</where>
|
|
</select>
|
|
<!--新增所有列-->
|
<insert id="insertOne" >
|
insert into work_material(id,material_name, consumable, stand_val, configuration_level, ma_base_id,big_classify_id, small_classify_id, big_classify_name, work_apply_id,use_count,dep_id,dep_name,md_id,receive_uids,receive_unames)
|
values (#{id},#{materialName}, #{consumable}, #{standVal}, #{configurationLevel}, #{maBaseId}, #{bigClassifyId}, #{smallClassifyId}, #{bigClassifyName}, #{workApplyId}, #{useCount},#{depId},#{depName},#{mdId},#{receiveUids},#{receiveUnames})
|
</insert>
|
|
|
<!--通过主键修改数据-->
|
<update id="updateOne">
|
update work_material
|
<set>
|
<if test="materialName != null and materialName != ''">
|
material_name = #{materialName},
|
</if>
|
<if test="consumable != null">
|
consumable = #{consumable},
|
</if>
|
<if test="standVal != null">
|
stand_val = #{standVal},
|
</if>
|
<if test="configurationLevel != null">
|
configuration_level = #{configurationLevel},
|
</if>
|
<if test="maBaseId != null">
|
ma_base_id = #{maBaseId},
|
</if>
|
<if test="bigClassifyId != null">
|
and big_classify_id = #{bigClassifyId}
|
</if>
|
<if test="bigClassifyName != null and bigClassifyName != ''">
|
and big_classify_name = #{bigClassifyName}
|
</if>
|
<if test="smallClassifyId != null">
|
and small_classify_id = #{smallClassifyId}
|
</if>
|
<if test="workApplyId != null">
|
work_apply_id = #{workApplyId}
|
</if>
|
<if test="useCount != null">
|
use_count = #{useCount}
|
</if>
|
<if test="depId != null">
|
dep_id = #{depId}
|
</if>
|
<if test="depName != null and depName != ''">
|
dep_name = #{depName}
|
</if>
|
</set>
|
where id = #{id}
|
</update>
|
|
<insert id="saveBatch" >
|
insert into work_material(id,material_name, consumable, stand_val, configuration_level, ma_base_id, big_classify_id, small_classify_id, big_classify_name,work_apply_id,use_count,dep_id,dep_name,md_id,receive_uids,receive_unames)
|
values
|
<foreach collection="entities" item="entity" separator=",">
|
(#{entity.id},#{entity.materialName}, #{entity.consumable}, #{entity.standVal}, #{entity.configurationLevel}, #{entity.maBaseId}, #{entity.bigClassifyId}, #{entity.smallClassifyId}, #{entity.bigClassifyName},#{entity.workApplyId}, #{entity.useCount}, #{entity.depId}, #{entity.depName}, #{entity.mdId},#{entity.receiveUids},#{entity.receiveUnames})
|
</foreach>
|
</insert>
|
|
</mapper>
|