SENDLOGMapper.xml 3.6 KB
<?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.tianbo.analysis.dao.SENDLOGMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.SENDLOG" >
    <result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
    <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
    <result column="OPAUTHOR" property="opauthor" jdbcType="VARCHAR" />
    <result column="SENDPEICE" property="sendpeice" jdbcType="DECIMAL" />
    <result column="SENDWEIGHT" property="sendweight" jdbcType="DECIMAL" />
    <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
    <result column="MESSAGETYPE" property="messagetype" jdbcType="VARCHAR" />
    <result column="MESSAGEAUTOID" property="messageautoid" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List">
    AUTOID, CREATEDATE, OPAUTHOR, SENDPEICE, SENDWEIGHT, RECEIPTION, MESSAGETYPE
  </sql>
  <select id="selectByMessageId" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from
    CGONMS.SENDLOG
    where
    MESSAGEAUTOID = #{messageautoid,jdbcType=VARCHAR}
    ORDER BY CREATEDATE DESC
  </select>

  <select id="checkWaybillPermit" parameterType="java.lang.String" resultMap="BaseResultMap">
    SELECT
	*
FROM
	SENDLOG
WHERE
	 MESSAGEAUTOID IN (
	SELECT
		AUTOID
	FROM
		ORIGINMANIFESTMASTER
	WHERE
		WAYBILLNOMASTER = #{waybillno,jdbcType=VARCHAR}
	)
	AND
	RECEIPTION LIKE '%放行%'
	AND
	MESSAGETYPE = 'MT1201'
  </select>
  <insert id="insert" parameterType="com.tianbo.analysis.model.SENDLOG">
    insert into CGONMS.SENDLOG (AUTOID, CREATEDATE, OPAUTHOR,
      SENDPEICE, SENDWEIGHT, RECEIPTION,
      MESSAGETYPE, MESSAGEAUTOID)
    values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{opauthor,jdbcType=VARCHAR},
      #{sendpeice,jdbcType=DECIMAL}, #{sendweight,jdbcType=DECIMAL}, #{receiption,jdbcType=VARCHAR},
      #{messagetype,jdbcType=VARCHAR}, #{messageautoid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.analysis.model.SENDLOG" >
    insert into CGONMS.SENDLOG
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="autoid != null" >
        AUTOID,
      </if>
      <if test="createdate != null" >
        CREATEDATE,
      </if>
      <if test="opauthor != null" >
        OPAUTHOR,
      </if>
      <if test="sendpeice != null" >
        SENDPEICE,
      </if>
      <if test="sendweight != null" >
        SENDWEIGHT,
      </if>
      <if test="receiption != null" >
        RECEIPTION,
      </if>
      <if test="messagetype != null" >
        MESSAGETYPE,
      </if>
      <if test="messageautoid != null" >
        MESSAGEAUTOID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="autoid != null" >
        #{autoid,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="opauthor != null" >
        #{opauthor,jdbcType=VARCHAR},
      </if>
      <if test="sendpeice != null" >
        #{sendpeice,jdbcType=DECIMAL},
      </if>
      <if test="sendweight != null" >
        #{sendweight,jdbcType=DECIMAL},
      </if>
      <if test="receiption != null" >
        #{receiption,jdbcType=VARCHAR},
      </if>
      <if test="messagetype != null" >
        #{messagetype,jdbcType=VARCHAR},
      </if>
      <if test="messageautoid != null" >
        #{messageautoid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
</mapper>