三方调度相关接口开发0724
This commit is contained in:
66
src/main/resources/mybatis/information/MtdMapper.xml
Normal file
66
src/main/resources/mybatis/information/MtdMapper.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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.zg.project.information.mapper.MtdMapper">
|
||||
|
||||
<resultMap id="MtdResultMap" type="com.zg.project.information.domain.Mtd">
|
||||
<id 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"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMtdById" parameterType="Long" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectMtdList" parameterType="Mtd" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd
|
||||
<where>
|
||||
<if test="mid != null and mid != ''">AND mid = #{mid}</if>
|
||||
<if test="desMat != null and desMat != ''">AND des_mat like concat('%', #{desMat}, '%')</if>
|
||||
<if test="grp != null and grp != ''">AND grp = #{grp}</if>
|
||||
<if test="unt != null and unt != ''">AND unt = #{unt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWlmsByWlbh" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
SELECT des_mat FROM mtd WHERE mid = #{materialCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertMtd" parameterType="Mtd">
|
||||
INSERT INTO mtd (mid, des_mat, grp, unt, uprc, btpe, mtpe, stpe)
|
||||
VALUES (#{mid}, #{desMat}, #{grp}, #{unt}, #{uprc}, #{btpe}, #{mtpe}, #{stpe})
|
||||
</insert>
|
||||
|
||||
<update id="updateMtd" parameterType="Mtd">
|
||||
UPDATE mtd
|
||||
SET mid = #{mid},
|
||||
des_mat = #{desMat},
|
||||
grp = #{grp},
|
||||
unt = #{unt},
|
||||
uprc = #{uprc},
|
||||
btpe = #{btpe},
|
||||
mtpe = #{mtpe},
|
||||
stpe = #{stpe}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMtdById" parameterType="Long">
|
||||
DELETE FROM mtd WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMtdByIds" parameterType="Long">
|
||||
DELETE FROM mtd WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user