2025-07-24 14:19:42 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2025-08-01 09:27:07 +08:00
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2025-07-24 14:19:42 +08:00
|
|
|
<mapper namespace="com.zg.project.information.mapper.MtdMapper">
|
2025-08-01 09:27:07 +08:00
|
|
|
|
|
|
|
|
<resultMap type="Mtd" id="MtdResult">
|
|
|
|
|
<result property="Id" column="Id" />
|
|
|
|
|
<result property="mid" column="mid" />
|
|
|
|
|
<result property="desMat" column="des_mat" />
|
|
|
|
|
<result property="grp" column="grp" />
|
|
|
|
|
<result property="unt" column="unt" />
|
|
|
|
|
<result property="uprc" column="uprc" />
|
|
|
|
|
<result property="btpe" column="btpe" />
|
|
|
|
|
<result property="mtpe" column="mtpe" />
|
|
|
|
|
<result property="stpe" column="stpe" />
|
2025-07-24 14:19:42 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
2025-08-01 09:27:07 +08:00
|
|
|
<sql id="selectMtdVo">
|
|
|
|
|
select Id, mid, des_mat, grp, unt, uprc, btpe, mtpe, stpe from mtd
|
|
|
|
|
</sql>
|
2025-07-24 14:19:42 +08:00
|
|
|
|
2025-08-01 09:27:07 +08:00
|
|
|
<select id="selectMtdList" parameterType="Mtd" resultMap="MtdResult">
|
|
|
|
|
<include refid="selectMtdVo"/>
|
2025-07-24 14:19:42 +08:00
|
|
|
<where>
|
2025-08-01 09:27:07 +08:00
|
|
|
<if test="mid != null and mid != ''"> AND mid LIKE CONCAT('%', #{mid}, '%')</if>
|
|
|
|
|
<if test="desMat != null and desMat != ''"> AND des_mat LIKE CONCAT('%', #{desMat}, '%')</if>
|
|
|
|
|
<if test="grp != null and grp != ''"> AND grp LIKE CONCAT('%', #{grp}, '%')</if>
|
|
|
|
|
<if test="unt != null and unt != ''"> AND unt LIKE CONCAT('%', #{unt}, '%')</if>
|
|
|
|
|
<if test="uprc != null and uprc != ''"> AND uprc LIKE CONCAT('%', #{uprc}, '%')</if>
|
|
|
|
|
<if test="btpe != null and btpe != ''"> AND btpe LIKE CONCAT('%', #{btpe}, '%')</if>
|
|
|
|
|
<if test="mtpe != null and mtpe != ''"> AND mtpe LIKE CONCAT('%', #{mtpe}, '%')</if>
|
|
|
|
|
<if test="stpe != null and stpe != ''"> AND stpe LIKE CONCAT('%', #{stpe}, '%')</if>
|
2025-07-24 14:19:42 +08:00
|
|
|
</where>
|
|
|
|
|
</select>
|
2025-08-01 09:27:07 +08:00
|
|
|
|
|
|
|
|
<select id="selectMtdById" parameterType="Long" resultMap="MtdResult">
|
|
|
|
|
<include refid="selectMtdVo"/>
|
|
|
|
|
where Id = #{Id}
|
|
|
|
|
</select>
|
2025-07-24 14:19:42 +08:00
|
|
|
|
|
|
|
|
<select id="selectWlmsByWlbh" resultType="java.lang.String" parameterType="java.lang.String">
|
2025-08-01 09:27:07 +08:00
|
|
|
SELECT des_mat
|
|
|
|
|
FROM mtd
|
|
|
|
|
WHERE mid = #{materialCode}
|
2025-07-24 14:19:42 +08:00
|
|
|
</select>
|
|
|
|
|
|
2025-10-29 10:15:30 +08:00
|
|
|
<select id="selectMtdByMid" resultMap="MtdResult">
|
|
|
|
|
SELECT * FROM mtd WHERE mid = #{mid} LIMIT 1
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-08-01 09:27:07 +08:00
|
|
|
<insert id="insertMtd" parameterType="Mtd" useGeneratedKeys="true" keyProperty="Id">
|
|
|
|
|
insert into mtd
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="mid != null">mid,</if>
|
|
|
|
|
<if test="desMat != null">des_mat,</if>
|
|
|
|
|
<if test="grp != null">grp,</if>
|
|
|
|
|
<if test="unt != null">unt,</if>
|
|
|
|
|
<if test="uprc != null">uprc,</if>
|
|
|
|
|
<if test="btpe != null">btpe,</if>
|
|
|
|
|
<if test="mtpe != null">mtpe,</if>
|
|
|
|
|
<if test="stpe != null">stpe,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="mid != null">#{mid},</if>
|
|
|
|
|
<if test="desMat != null">#{desMat},</if>
|
|
|
|
|
<if test="grp != null">#{grp},</if>
|
|
|
|
|
<if test="unt != null">#{unt},</if>
|
|
|
|
|
<if test="uprc != null">#{uprc},</if>
|
|
|
|
|
<if test="btpe != null">#{btpe},</if>
|
|
|
|
|
<if test="mtpe != null">#{mtpe},</if>
|
|
|
|
|
<if test="stpe != null">#{stpe},</if>
|
|
|
|
|
</trim>
|
2025-07-24 14:19:42 +08:00
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateMtd" parameterType="Mtd">
|
2025-08-01 09:27:07 +08:00
|
|
|
update mtd
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="mid != null">mid = #{mid},</if>
|
|
|
|
|
<if test="desMat != null">des_mat = #{desMat},</if>
|
|
|
|
|
<if test="grp != null">grp = #{grp},</if>
|
|
|
|
|
<if test="unt != null">unt = #{unt},</if>
|
|
|
|
|
<if test="uprc != null">uprc = #{uprc},</if>
|
|
|
|
|
<if test="btpe != null">btpe = #{btpe},</if>
|
|
|
|
|
<if test="mtpe != null">mtpe = #{mtpe},</if>
|
|
|
|
|
<if test="stpe != null">stpe = #{stpe},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where Id = #{Id}
|
2025-07-24 14:19:42 +08:00
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteMtdById" parameterType="Long">
|
2025-08-01 09:27:07 +08:00
|
|
|
delete from mtd where Id = #{Id}
|
2025-07-24 14:19:42 +08:00
|
|
|
</delete>
|
|
|
|
|
|
2025-08-01 09:27:07 +08:00
|
|
|
<delete id="deleteMtdByIds" parameterType="String">
|
|
|
|
|
delete from mtd where Id in
|
|
|
|
|
<foreach item="Id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{Id}
|
2025-07-24 14:19:42 +08:00
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2025-08-01 09:27:07 +08:00
|
|
|
</mapper>
|