Commit 0b490e21 by zhengxj

finish 订单流转状态记录 on 20190219 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17467 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 8636a0b0
package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.pojo.SysOrderStatus;
......@@ -9,7 +8,7 @@ import com.glsx.ordercenter.pojo.SysOrderStatusExample;
public interface SysOrderStatusMapper {
long countByExample(SysOrderStatusExample example);
int deleteByPrimaryKey(Integer orderId);
int deleteByPrimaryKey(Integer id);
int insert(SysOrderStatus record);
......@@ -17,7 +16,7 @@ public interface SysOrderStatusMapper {
List<SysOrderStatus> selectByExample(SysOrderStatusExample example);
SysOrderStatus selectByPrimaryKey(Integer orderId);
SysOrderStatus selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrderStatus record);
......
package com.glsx.ordercenter.pojo;
import java.util.Date;
public class SysOrderStatus {
private Integer id;
private Integer orderId;
private String activeStatusArray;
private Byte activeStatus;
private Date updateTime;
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOrderId() {
return orderId;
......@@ -13,11 +29,27 @@ public class SysOrderStatus {
this.orderId = orderId;
}
public String getActiveStatusArray() {
return activeStatusArray;
public Byte getActiveStatus() {
return activeStatus;
}
public void setActiveStatus(Byte activeStatus) {
this.activeStatus = activeStatus;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setActiveStatusArray(String activeStatusArray) {
this.activeStatusArray = activeStatusArray == null ? null : activeStatusArray.trim();
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
}
\ No newline at end of file
......@@ -2,8 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.ordercenter.mapper.SysOrderStatusMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOrderStatus">
<id column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="active_status_array" jdbcType="VARCHAR" property="activeStatusArray" />
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="active_status" jdbcType="TINYINT" property="activeStatus" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -35,7 +38,7 @@
</where>
</sql>
<sql id="Base_Column_List">
order_id, active_status_array
id, order_id, active_status, update_time, remark
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderStatusExample" resultMap="BaseResultMap">
select
......@@ -56,32 +59,52 @@
select
<include refid="Base_Column_List" />
from sys_order_status
where order_id = #{orderId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_order_status
where order_id = #{orderId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
insert into sys_order_status (order_id, active_status_array)
values (#{orderId,jdbcType=INTEGER}, #{activeStatusArray,jdbcType=VARCHAR})
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_status (order_id, active_status, update_time,
remark)
values (#{orderId,jdbcType=INTEGER}, #{activeStatus,jdbcType=TINYINT}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_status
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">
order_id,
</if>
<if test="activeStatusArray != null">
active_status_array,
<if test="activeStatus != null">
active_status,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
#{orderId,jdbcType=INTEGER},
</if>
<if test="activeStatusArray != null">
#{activeStatusArray,jdbcType=VARCHAR},
<if test="activeStatus != null">
#{activeStatus,jdbcType=TINYINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
......@@ -94,15 +117,27 @@
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
update sys_order_status
<set>
<if test="activeStatusArray != null">
active_status_array = #{activeStatusArray,jdbcType=VARCHAR},
<if test="orderId != null">
order_id = #{orderId,jdbcType=INTEGER},
</if>
<if test="activeStatus != null">
active_status = #{activeStatus,jdbcType=TINYINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where order_id = #{orderId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderStatus">
update sys_order_status
set active_status_array = #{activeStatusArray,jdbcType=VARCHAR}
where order_id = #{orderId,jdbcType=INTEGER}
</update>
set order_id = #{orderId,jdbcType=INTEGER},
active_status = #{activeStatus,jdbcType=TINYINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!