新增物料字典模块
修改出入库单据号逻辑 新增出入库撤销和恢复功能
This commit is contained in:
@@ -1,66 +1,97 @@
|
||||
<?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">
|
||||
|
||||
<!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 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" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMtdById" parameterType="Long" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd WHERE id = #{id}
|
||||
</select>
|
||||
<sql id="selectMtdVo">
|
||||
select Id, mid, des_mat, grp, unt, uprc, btpe, mtpe, stpe from mtd
|
||||
</sql>
|
||||
|
||||
<select id="selectMtdList" parameterType="Mtd" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd
|
||||
<select id="selectMtdList" parameterType="Mtd" resultMap="MtdResult">
|
||||
<include refid="selectMtdVo"/>
|
||||
<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>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMtdById" parameterType="Long" resultMap="MtdResult">
|
||||
<include refid="selectMtdVo"/>
|
||||
where Id = #{Id}
|
||||
</select>
|
||||
|
||||
<select id="selectWlmsByWlbh" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
SELECT des_mat FROM mtd WHERE mid = #{materialCode}
|
||||
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 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>
|
||||
</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 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}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMtdById" parameterType="Long">
|
||||
DELETE FROM mtd WHERE id = #{id}
|
||||
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}
|
||||
<delete id="deleteMtdByIds" parameterType="String">
|
||||
delete from mtd where Id in
|
||||
<foreach item="Id" collection="array" open="(" separator="," close=")">
|
||||
#{Id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user