|
@@ -0,0 +1,180 @@
|
|
|
+<?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.zkqy.business.mapper.MaterialCirculationMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.MaterialCirculation" id="MaterialCirculationResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="goodsname" column="goodsname" />
|
|
|
+ <result property="goodsnum" column="goodsnum" />
|
|
|
+ <result property="specifications" column="specifications" />
|
|
|
+ <result property="weight" column="weight" />
|
|
|
+ <result property="receivingProcess" column="receiving_process" />
|
|
|
+ <result property="approvalStatus" column="approval_status" />
|
|
|
+ <result property="documentStatus" column="document_status" />
|
|
|
+ <result property="submitter" column="submitter" />
|
|
|
+ <result property="approvedBy" column="approved_by" />
|
|
|
+ <result property="completedBy" column="completed_by" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="taskProcessKey" column="task_process_key" />
|
|
|
+ <result property="taskNodeKey" column="task_node_key" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMaterialCirculationVo">
|
|
|
+ select id, goodsname, goodsnum, specifications, weight, receiving_process, approval_status, document_status, submitter, approved_by, completed_by, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from material_circulation
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMaterialCirculationList" parameterType="com.zkqy.business.domain.MaterialCirculation" resultMap="MaterialCirculationResult">
|
|
|
+ <include refid="selectMaterialCirculationVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="goodsname != null and goodsname != ''"> and goodsname like concat('%', #{goodsname}, '%')</if>
|
|
|
+ <if test="goodsnum != null and goodsnum != ''"> and goodsnum = #{goodsnum}</if>
|
|
|
+ <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
|
|
|
+ <if test="weight != null and weight != ''"> and weight = #{weight}</if>
|
|
|
+ <if test="receivingProcess != null and receivingProcess != ''"> and receiving_process = #{receivingProcess}</if>
|
|
|
+ <if test="approvalStatus != null and approvalStatus != ''"> and approval_status = #{approvalStatus}</if>
|
|
|
+ <if test="documentStatus != null and documentStatus != ''"> and document_status = #{documentStatus}</if>
|
|
|
+ <if test="submitter != null and submitter != ''"> and submitter = #{submitter}</if>
|
|
|
+ <if test="approvedBy != null and approvedBy != ''"> and approved_by = #{approvedBy}</if>
|
|
|
+ <if test="completedBy != null and completedBy != ''"> and completed_by = #{completedBy}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+ <if test="taskProcessKey != null and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
|
|
|
+ <if test="taskNodeKey != null and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaterialCirculationById" parameterType="Long" resultMap="MaterialCirculationResult">
|
|
|
+ <include refid="selectMaterialCirculationVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMaterialCirculation" parameterType="com.zkqy.business.domain.MaterialCirculation" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into material_circulation
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="goodsname != null">goodsname,</if>
|
|
|
+ <if test="goodsnum != null">goodsnum,</if>
|
|
|
+ <if test="specifications != null">specifications,</if>
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
+ <if test="receivingProcess != null">receiving_process,</if>
|
|
|
+ <if test="approvalStatus != null">approval_status,</if>
|
|
|
+ <if test="documentStatus != null">document_status,</if>
|
|
|
+ <if test="submitter != null">submitter,</if>
|
|
|
+ <if test="approvedBy != null">approved_by,</if>
|
|
|
+ <if test="completedBy != null">completed_by,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key,</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="goodsname != null">#{goodsname},</if>
|
|
|
+ <if test="goodsnum != null">#{goodsnum},</if>
|
|
|
+ <if test="specifications != null">#{specifications},</if>
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
+ <if test="receivingProcess != null">#{receivingProcess},</if>
|
|
|
+ <if test="approvalStatus != null">#{approvalStatus},</if>
|
|
|
+ <if test="documentStatus != null">#{documentStatus},</if>
|
|
|
+ <if test="submitter != null">#{submitter},</if>
|
|
|
+ <if test="approvedBy != null">#{approvedBy},</if>
|
|
|
+ <if test="completedBy != null">#{completedBy},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">#{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">#{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMaterialCirculation" parameterType="com.zkqy.business.domain.MaterialCirculation">
|
|
|
+ update material_circulation
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="goodsname != null">goodsname = #{goodsname},</if>
|
|
|
+ <if test="goodsnum != null">goodsnum = #{goodsnum},</if>
|
|
|
+ <if test="specifications != null">specifications = #{specifications},</if>
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
+ <if test="receivingProcess != null">receiving_process = #{receivingProcess},</if>
|
|
|
+ <if test="approvalStatus != null">approval_status = #{approvalStatus},</if>
|
|
|
+ <if test="documentStatus != null">document_status = #{documentStatus},</if>
|
|
|
+ <if test="submitter != null">submitter = #{submitter},</if>
|
|
|
+ <if test="approvedBy != null">approved_by = #{approvedBy},</if>
|
|
|
+ <if test="completedBy != null">completed_by = #{completedBy},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialCirculationById" parameterType="Long">
|
|
|
+ delete from material_circulation where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMaterialCirculationByIds" parameterType="String">
|
|
|
+ delete from material_circulation where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectHandheldMaterialCirculationList" resultType="com.zkqy.business.domain.MaterialCirculation">
|
|
|
+ SELECT
|
|
|
+ mc.id,
|
|
|
+ m.materiel_name AS goodsname,
|
|
|
+ mc.goodsnum,
|
|
|
+ m.specification_model AS specifications,
|
|
|
+ mc.weight,
|
|
|
+ mc.receiving_process,
|
|
|
+ mc.approval_status,
|
|
|
+ mc.document_status,
|
|
|
+ mc.submitter,
|
|
|
+ mc.approved_by,
|
|
|
+ mc.completed_by,
|
|
|
+ mc.remark,
|
|
|
+ mc.create_by_id,
|
|
|
+ mc.create_by,
|
|
|
+ mc.create_time,
|
|
|
+ mc.update_by_id,
|
|
|
+ mc.update_by,
|
|
|
+ mc.update_time
|
|
|
+ FROM
|
|
|
+ {DBNAME}.material_circulation mc
|
|
|
+ LEFT JOIN {DBNAME}.materiel m ON mc.goodsnum = m.materiel_code
|
|
|
+ WHERE
|
|
|
+ mc.del_flag = '0'
|
|
|
+ AND mc.approval_status = '2'
|
|
|
+ AND mc.document_status != '0'
|
|
|
+ <if test="goodsnum != ''"> and mc.goodsnum = #{goodsnum}</if>
|
|
|
+ order by mc.id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|