|
|
<?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.gaotao.modules.purchaseorder.dao.PRHeaderMapper"> <resultMap id="BaseResultMap" type="com.gaotao.modules.purchaseorder.entity.PRHeader"> <!--@mbg.generated--> <!--@Table PRHeader--> <id column="RequisitionNo" jdbcType="VARCHAR" property="requisitionno"/> <id column="Site" jdbcType="VARCHAR" property="site"/> <result column="RequisitionDate" jdbcType="TIMESTAMP" property="requisitiondate"/> <result column="EnterDate" jdbcType="TIMESTAMP" property="enterdate"/> <result column="UserName" jdbcType="VARCHAR" property="username"/> <result column="Requisitioner" jdbcType="VARCHAR" property="requisitioner"/> <result column="Status" jdbcType="VARCHAR" property="status"/> <result column="Printed" jdbcType="CHAR" property="printed"/> <result column="OrderType" jdbcType="VARCHAR" property="ordertype"/> <result column="Remark" jdbcType="VARCHAR" property="remark"/> <result column="authorizeFlag" jdbcType="CHAR" property="authorizeFlag"/> <result column="approvedFlag" jdbcType="CHAR" property="approvedFlag"/> <result column="approveResult" jdbcType="VARCHAR" property="approveResult"/> <result column="Authorizator" jdbcType="VARCHAR" property="authorizator"/> <result column="authorizeDate" jdbcType="TIMESTAMP" property="authorizeDate"/> <result column="OrderRef1" jdbcType="VARCHAR" property="orderref1"/> <result column="AuthRuleID" jdbcType="VARCHAR" property="authruleid"/> </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> RequisitionNo, Site, RequisitionDate, EnterDate, UserName, Requisitioner, Status, Printed, OrderType, Remark, authorizeFlag, approvedFlag, approveResult, Authorizator, authorizeDate, OrderRef1, AuthRuleID </sql> <select id="getPRHeaderList" resultMap="BaseResultMap"> <!--@mbg.generated--> select
<include refid="Base_Column_List"/>
from PRHeader
<where> <if test="param2.site != null and param2.site != ''"> and Site= #{param2.site,jdbcType=VARCHAR}
</if> <if test="param2.requisitionno != null and param2.requisitionno != ''">
and RequisitionNo= #{param2.requisitionno,jdbcType=VARCHAR} </if> </where> </select> <insert id="insertSelective"> <!--@mbg.generated--> INSERT INTO PRHeader
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="requisitionno != null and requisitionno != ''"> RequisitionNo, </if> <if test="site != null and site != ''"> Site, </if> <if test="requisitiondate != null"> RequisitionDate, </if> <if test="enterdate != null"> EnterDate, </if> <if test="username != null and username != ''"> UserName, </if> <if test="requisitioner != null and requisitioner != ''"> Requisitioner, </if> <if test="status != null and status != ''"> Status, </if> <if test="printed != null and printed != ''"> Printed, </if> <if test="orderType != null and orderType != ''"> OrderType, </if> <if test="remark != null and remark != ''"> Remark, </if> <if test="authorizeFlag != null and authorizeFlag != ''"> authorizeFlag, </if> <if test="approvedFlag != null and approvedFlag != ''"> approvedFlag, </if> <if test="approveResult != null and approveResult != ''"> approveResult, </if> <if test="authorizator != null and authorizator != ''"> Authorizator, </if> <if test="authorizeDate != null"> authorizeDate, </if> <if test="orderref1 != null and orderref1 != ''"> OrderRef1, </if> <if test="authruleid != null and authruleid != ''"> AuthRuleID </if> </trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <if test="requisitionno != null and requisitionno != ''"> #{requisitionno,jdbcType=VARCHAR}, </if> <if test="site != null and site != ''"> #{site,jdbcType=VARCHAR}, </if> <if test="requisitiondate != null"> #{requisitiondate,jdbcType=TIMESTAMP}, </if> <if test="enterdate != null"> #{enterdate,jdbcType=TIMESTAMP}, </if> <if test="username != null and username != ''"> #{username,jdbcType=VARCHAR}, </if> <if test="requisitioner != null and requisitioner != ''"> #{requisitioner,jdbcType=VARCHAR}, </if> <if test="status != null and status != ''"> #{status,jdbcType=VARCHAR}, </if> <if test="printed != null and printed != ''"> #{printed,jdbcType=CHAR}, </if> <if test="orderType != null and orderType != ''"> #{orderType,jdbcType=VARCHAR}, </if> <if test="remark != null and remark != ''"> #{remark,jdbcType=VARCHAR}, </if> <if test="authorizeFlag != null and authorizeFlag != ''"> #{authorizeFlag,jdbcType=CHAR}, </if> <if test="approvedFlag != null and approvedFlag != ''"> #{approvedFlag,jdbcType=CHAR}, </if> <if test="approveResult != null and approveResult != ''"> #{approveResult,jdbcType=VARCHAR}, </if> <if test="authorizator != null and authorizator != ''"> #{authorizator,jdbcType=VARCHAR}, </if> <if test="authorizeDate != null"> #{authorizeDate,jdbcType=TIMESTAMP}, </if> <if test="orderref1 != null and orderref1 != ''"> #{orderref1,jdbcType=VARCHAR}, </if> <if test="authruleid != null and authruleid != ''"> #{authruleid,jdbcType=VARCHAR} </if> </trim> </insert> <update id="updatePRHeader"> <!--@mbg.generated--> update PRHeader
<set> <if test="requisitiondate != null">
RequisitionDate = #{requisitiondate,jdbcType=TIMESTAMP},
</if> <if test="enterdate != null">
EnterDate = #{enterdate,jdbcType=TIMESTAMP},
</if> <if test="username != null">
UserName = #{username,jdbcType=VARCHAR},
</if> <if test="requisitioner != null">
Requisitioner = #{requisitioner,jdbcType=VARCHAR},
</if> <if test="status != null">
Status = #{status,jdbcType=VARCHAR},
</if> <if test="printed != null">
Printed = #{printed,jdbcType=CHAR},
</if> <if test="ordertype != null">
OrderType = #{ordertype,jdbcType=VARCHAR},
</if> <if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if> <if test="authorizeFlag != null">
authorizeFlag = #{authorizeFlag,jdbcType=CHAR},
</if> <if test="approvedFlag != null">
approvedFlag = #{approvedFlag,jdbcType=CHAR},
</if> <if test="approveResult != null">
approveResult = #{approveResult,jdbcType=VARCHAR},
</if> <if test="authorizator != null">
Authorizator = #{authorizator,jdbcType=VARCHAR},
</if> <if test="authorizeDate != null">
authorizeDate = #{authorizeDate,jdbcType=TIMESTAMP},
</if> <if test="orderref1 != null">
OrderRef1 = #{orderref1,jdbcType=VARCHAR},
</if> <if test="authruleid != null">
AuthRuleID = #{authruleid,jdbcType=VARCHAR}, </if> </set> <where> <if test="site != null"> and Site=#{site,jdbcType=VARCHAR}
</if> <if test="requisitionno != null">
and RequisitionNo=#{requisitionno,jdbcType=VARCHAR} </if> </where> </update> <delete id="deletePRHeader"> <!--@mbg.generated--> delete from PRHeader
<where> <if test="site != null"> and Site=#{site,jdbcType=VARCHAR}
</if> <if test="requisitionno != null">
and RequisitionNo=#{requisitionno,jdbcType=VARCHAR} </if> </where> </delete> <select id="getTransNo" resultType="java.lang.String"> select dbo.Get_TransNo(#{site},#{dbType}) </select> <update id="updateTransNo"> exec dbo.UpdateTransNo #{site},#{dbType} </update> <update id="updateReceiveToolDetail"> update po_receipt_detail_sub set tool_instance_id = #{newToolInstanceId} where tool_instance_id = #{toolInstanceId} and site = #{site} </update></mapper>
|