<?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.jcdm.main.bs.material.mapper.BsMaterialInfoMapper">
|
<resultMap type="BsMaterialInfo" id="BsMaterialInfoResult">
|
<result property="id" column="id" />
|
<result property="materialCode" column="material_code" />
|
<result property="materialName" column="material_name" />
|
<result property="materialView" column="material_view" />
|
<result property="typeZ" column="type_z" />
|
<result property="typeL" column="type_l" />
|
<result property="unit" column="unit" />
|
<result property="matterVersion" column="matter_version" />
|
<result property="remarks" column="remarks" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="erpSpec" column="erp_spec" />
|
<result property="dataSource" column="data_source" />
|
<result property="version" column="version" />
|
<result property="status" column="status" />
|
<result property="supplier" column="supplier" />
|
<result property="mark" column="mark" />
|
</resultMap>
|
|
<sql id="selectBsMaterialInfoVo">
|
select id, material_code, mark, material_name, material_view, type_z, type_l, unit, matter_version, remarks, create_user, create_time, update_user, update_time, erp_spec, data_source, version, status, supplier from bs_material_info
|
</sql>
|
|
<select id="selectBsMaterialInfoList" parameterType="BsMaterialInfo" resultMap="BsMaterialInfoResult">
|
<include refid="selectBsMaterialInfoVo"/>
|
<where>
|
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
<if test="mark != null and mark != ''"> and mark like concat('%', #{mark}, '%')</if>
|
<if test="materialView != null and materialView != ''"> and material_view = #{materialView}</if>
|
<if test="typeZ != null and typeZ != ''"> and type_z = #{typeZ}</if>
|
<if test="typeL != null and typeL != ''"> and type_l = #{typeL}</if>
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
<if test="matterVersion != null and matterVersion != ''"> and matter_version = #{matterVersion}</if>
|
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
<if test="erpSpec != null and erpSpec != ''"> and erp_spec = #{erpSpec}</if>
|
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if>
|
<if test="version != null and version != ''"> and version = #{version}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
|
</where>
|
</select>
|
|
<select id="selectBsMaterialInfoById" parameterType="Long" resultMap="BsMaterialInfoResult">
|
<include refid="selectBsMaterialInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsMaterialInfo" parameterType="BsMaterialInfo">
|
insert into bs_material_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="materialCode != null">material_code,</if>
|
<if test="materialName != null">material_name,</if>
|
<if test="mark != null">mark,</if>
|
<if test="materialView != null">material_view,</if>
|
<if test="typeZ != null">type_z,</if>
|
<if test="typeL != null">type_l,</if>
|
<if test="unit != null">unit,</if>
|
<if test="matterVersion != null">matter_version,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="erpSpec != null">erp_spec,</if>
|
<if test="dataSource != null">data_source,</if>
|
<if test="version != null">version,</if>
|
<if test="status != null">status,</if>
|
<if test="supplier != null">supplier,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="materialCode != null">#{materialCode},</if>
|
<if test="materialName != null">#{materialName},</if>
|
<if test="mark != null">#{mark},</if>
|
<if test="materialView != null">#{materialView},</if>
|
<if test="typeZ != null">#{typeZ},</if>
|
<if test="typeL != null">#{typeL},</if>
|
<if test="unit != null">#{unit},</if>
|
<if test="matterVersion != null">#{matterVersion},</if>
|
<if test="remarks != null">#{remarks},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="erpSpec != null">#{erpSpec},</if>
|
<if test="dataSource != null">#{dataSource},</if>
|
<if test="version != null">#{version},</if>
|
<if test="status != null">#{status},</if>
|
<if test="supplier != null">#{supplier},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsMaterialInfo" parameterType="BsMaterialInfo">
|
update bs_material_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
<if test="materialName != null">material_name = #{materialName},</if>
|
<if test="mark != null">mark = #{mark},</if>
|
<if test="materialView != null">material_view = #{materialView},</if>
|
<if test="typeZ != null">type_z = #{typeZ},</if>
|
<if test="typeL != null">type_l = #{typeL},</if>
|
<if test="unit != null">unit = #{unit},</if>
|
<if test="matterVersion != null">matter_version = #{matterVersion},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="erpSpec != null">erp_spec = #{erpSpec},</if>
|
<if test="dataSource != null">data_source = #{dataSource},</if>
|
<if test="version != null">version = #{version},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="supplier != null">supplier = #{supplier},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsMaterialInfoById" parameterType="Long">
|
delete from bs_material_info where id = #{id}
|
</delete>
|
|
<delete id="deleteBsMaterialInfoByIds" parameterType="String">
|
delete from bs_material_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|