| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?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.TOrderExamineMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderExamine">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="aname" jdbcType="VARCHAR" property="aname" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="tid" jdbcType="INTEGER" property="tid" />
- </resultMap>
- <sql id="Base_Column_List">
- id, order_no, aid, `status`, create_time, aname, `type`, tid
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order_examine
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from t_order_examine
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
- insert into t_order_examine (order_no, aid, `status`,
- create_time, aname, `type`,
- tid)
- values (#{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
- #{tid,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
- insert into t_order_examine
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">
- order_no,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="aname != null">
- aname,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="tid != null">
- tid,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">
- #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aname != null">
- #{aname,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- #{tid,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderExamine">
- update t_order_examine
- <set>
- <if test="orderNo != null">
- order_no = #{orderNo,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="aname != null">
- aname = #{aname,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- `type` = #{type,jdbcType=INTEGER},
- </if>
- <if test="tid != null">
- tid = #{tid,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderExamine">
- update t_order_examine
- set order_no = #{orderNo,jdbcType=VARCHAR},
- aid = #{aid,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- aname = #{aname,jdbcType=VARCHAR},
- `type` = #{type,jdbcType=INTEGER},
- tid = #{tid,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByOrderNo" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order_examine
- where order_no = #{orderNo,jdbcType=VARCHAR} and type = #{type,jdbcType=INTEGER}
- </select>
- <update id="updateStatusByOrderNo">
- update t_order_examine
- set status= #{status}
- where order_no = #{orderNo,jdbcType=VARCHAR}
- <if test="aid!=null">
- and aid = #{aid}
- </if>
- </update>
- <insert id="insertBatch">
- insert into t_order_examine (order_no, aid, `status`, aname,type,tid)
- values
- <foreach item="item" index="index" collection="list" separator=",">
- (#{item.orderNo,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER},
- #{item.aname,jdbcType=VARCHAR},#{item.type,jdbcType=INTEGER},#{item.tid,jdbcType=INTEGER})
- </foreach>
- </insert>
- <select id="selectByOrderNoAndAid" resultType="java.lang.Integer">
- select count(*)
- from t_order_examine where status=0
- and order_no = #{orderNo} and aid= #{aid}
- </select>
- <select id="selectByTid" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order_examine
- where tid = #{tid}
- </select>
- <delete id="deleteByOrderNo">
- delete from t_order_examine
- where order_no = #{orderNo}
- </delete>
- <delete id="deleteByTid">
- delete from t_order_examine
- where tid = #{tid}
- </delete>
- <select id="selectExamineBytidAndAid" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order_examine a
- where tid in
- <foreach item="item" index="index" collection="list" separator="," open="(" close=")">
- #{item}
- </foreach>
- and a.aid= #{aid}
- </select>
- </mapper>
|