| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?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.goafanti.common.dao.TDunLogMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TDunLog">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="dun_id" jdbcType="VARCHAR" property="dunId" />
- <result column="dum_by" jdbcType="VARCHAR" property="dumBy" />
- <result column="dum_time" jdbcType="DATE" property="dumTime" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- </resultMap>
- <sql id="Base_Column_List">
- id, dun_id, dum_by, dum_time, remarks, attachment_url, `type`, order_no
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_dun_log
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from t_dun_log
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.TDunLog">
- insert into t_dun_log (id, dun_id, dum_by,
- dum_time, remarks, attachment_url,
- `type`, order_no)
- values (#{id,jdbcType=VARCHAR}, #{dunId,jdbcType=VARCHAR}, #{dumBy,jdbcType=VARCHAR},
- #{dumTime,jdbcType=DATE}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
- #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TDunLog">
- insert into t_dun_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="dunId != null">
- dun_id,
- </if>
- <if test="dumBy != null">
- dum_by,
- </if>
- <if test="dumTime != null">
- dum_time,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="attachmentUrl != null">
- attachment_url,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="orderNo != null">
- order_no,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="dunId != null">
- #{dunId,jdbcType=VARCHAR},
- </if>
- <if test="dumBy != null">
- #{dumBy,jdbcType=VARCHAR},
- </if>
- <if test="dumTime != null">
- #{dumTime,jdbcType=DATE},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="attachmentUrl != null">
- #{attachmentUrl,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TDunLog">
- update t_dun_log
- <set>
- <if test="dunId != null">
- dun_id = #{dunId,jdbcType=VARCHAR},
- </if>
- <if test="dumBy != null">
- dum_by = #{dumBy,jdbcType=VARCHAR},
- </if>
- <if test="dumTime != null">
- dum_time = #{dumTime,jdbcType=DATE},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="attachmentUrl != null">
- attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TDunLog">
- update t_dun_log
- set dun_id = #{dunId,jdbcType=VARCHAR},
- dum_by = #{dumBy,jdbcType=VARCHAR},
- dum_time = #{dumTime,jdbcType=DATE},
- remarks = #{remarks,jdbcType=VARCHAR},
- attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- order_no = #{orderNo,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="selectByDunId" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TDunLogListBo">
- select
- a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks
- from t_dun_log a left join admin b on a.dum_by=b.id
- where dun_id = #{dunId,jdbcType=VARCHAR}
- </select>
- <select id="selectByOrderNo" resultType="com.goafanti.order.bo.TDunLogListBo">
- select a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks,a.type,
- a.attachment_url attachmentUrl, c.order_no orderNo,c.buyer_name userName
- from t_dun_log a left join admin b on a.dum_by=b.id left join t_order_mid c on a.order_no =c.order_no
- where c.order_no = #{orderNo}
- </select>
- </mapper>
|