Commit 997d5ee9 by zhengxj

finish 统计门店某段时间的订单量 on 20190214 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17346 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent c8061a60
......@@ -150,8 +150,8 @@ public class OrderController {
@RequestMapping(value = "/getStatistic", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getStatistic(HttpServletRequest request) {
// TODO 获取当前用户
Integer userId=12;
String userName=UserUtils.getUserName(request);
// Integer userId=12;
int userId=UserUtils.getUserId(request);
OrderStastic orderStastic = orderService.getStatistic(userId);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), orderStastic);
}
......@@ -160,8 +160,7 @@ public class OrderController {
@RequestMapping(value = "/getBizAmount", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getBizAmount(HttpServletRequest request,String selectType,Date startDate,Date endDate) {
// TODO 获取当前用户
// TODO 获取当前用户
Integer userId=UserUtils.getUserId(request);
BizAmountResp bizAmountResp = orderService.getBizAmount(userId,selectType,startDate,endDate);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), bizAmountResp);
......
package com.glsx.ordercenter.pojo.user;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
public class SysUser {
private Integer id;
import com.glsx.ordercenter.pojo.BaseModel;
public class SysUser extends BaseModel {
/**
* 主键id
*/
private Integer id;
/**
* 用户id
*/
private Integer userId;
/**
* 用户登录名
*/
private String username;
/**
* 用户名称
*/
private String name;
/**
* 所属组织id
*/
private Integer orgId;
/**
* 手机号
*/
private String phoneNumber;
/**
*用户状态
*/
private Integer userStatus;
private Byte userStatus;
/**
*用户密码
*/
private String password;
private String createBy;
/**
*性别
*/
private String sex;
private Date createTime;
private String updateBy;
/**
*用户类型
*/
private Integer userType;
private Date updateTime;
/**
*所属部门名称
*/
private String orgName;
private String password;
/**
*服务项
*/
private String serviceItems;
private String sex;
private List<Integer> rolesId = new ArrayList<>();
private String remark;
private List<Integer> orgsId = new ArrayList<>();
private Byte userType;
public Integer getUserId() {
return userId;
public Integer getId() {
return id;
}
public void setUserId(Integer userId) {
this.userId = userId;
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
......@@ -110,80 +68,78 @@ public class SysUser extends BaseModel {
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
this.phoneNumber = phoneNumber == null ? null : phoneNumber.trim();
}
public Integer getUserStatus() {
public Byte getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
public void setUserStatus(Byte userStatus) {
this.userStatus = userStatus;
}
public String getPassword() {
return password;
public String getCreateBy() {
return createBy;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getSex() {
return sex;
public Date getCreateTime() {
return createTime;
}
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public List<Integer> getRolesId() {
return rolesId;
public String getUpdateBy() {
return updateBy;
}
public void setRolesId(List<Integer> rolesId) {
this.rolesId = rolesId;
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public List<Integer> getOrgsId() {
return orgsId;
public Date getUpdateTime() {
return updateTime;
}
public void setOrgsId(List<Integer> orgsId) {
this.orgsId = orgsId;
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPassword() {
return password;
}
public Integer getUserType() {
return userType;
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public void setUserType(Integer userType) {
this.userType = userType;
public String getSex() {
return sex;
}
public String getOrgName() {
return orgName;
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
public void setOrgName(String orgName) {
this.orgName = orgName;
public String getRemark() {
return remark;
}
public String getServiceItems() {
return serviceItems;
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public void setServiceItems(String serviceItems) {
this.serviceItems = serviceItems;
public Byte getUserType() {
return userType;
}
}
public void setUserType(Byte userType) {
this.userType = userType;
}
}
\ No newline at end of file
......@@ -375,52 +375,62 @@ public class SysUserExample {
return (Criteria) this;
}
public Criteria andPhoneNumberEqualTo(Integer value) {
public Criteria andPhoneNumberEqualTo(String value) {
addCriterion("phone_number =", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberNotEqualTo(Integer value) {
public Criteria andPhoneNumberNotEqualTo(String value) {
addCriterion("phone_number <>", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberGreaterThan(Integer value) {
public Criteria andPhoneNumberGreaterThan(String value) {
addCriterion("phone_number >", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberGreaterThanOrEqualTo(Integer value) {
public Criteria andPhoneNumberGreaterThanOrEqualTo(String value) {
addCriterion("phone_number >=", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberLessThan(Integer value) {
public Criteria andPhoneNumberLessThan(String value) {
addCriterion("phone_number <", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberLessThanOrEqualTo(Integer value) {
public Criteria andPhoneNumberLessThanOrEqualTo(String value) {
addCriterion("phone_number <=", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberIn(List<Integer> values) {
public Criteria andPhoneNumberLike(String value) {
addCriterion("phone_number like", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberNotLike(String value) {
addCriterion("phone_number not like", value, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberIn(List<String> values) {
addCriterion("phone_number in", values, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberNotIn(List<Integer> values) {
public Criteria andPhoneNumberNotIn(List<String> values) {
addCriterion("phone_number not in", values, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberBetween(Integer value1, Integer value2) {
public Criteria andPhoneNumberBetween(String value1, String value2) {
addCriterion("phone_number between", value1, value2, "phoneNumber");
return (Criteria) this;
}
public Criteria andPhoneNumberNotBetween(Integer value1, Integer value2) {
public Criteria andPhoneNumberNotBetween(String value1, String value2) {
addCriterion("phone_number not between", value1, value2, "phoneNumber");
return (Criteria) this;
}
......@@ -815,76 +825,6 @@ public class SysUserExample {
return (Criteria) this;
}
public Criteria andMailIsNull() {
addCriterion("mail is null");
return (Criteria) this;
}
public Criteria andMailIsNotNull() {
addCriterion("mail is not null");
return (Criteria) this;
}
public Criteria andMailEqualTo(String value) {
addCriterion("mail =", value, "mail");
return (Criteria) this;
}
public Criteria andMailNotEqualTo(String value) {
addCriterion("mail <>", value, "mail");
return (Criteria) this;
}
public Criteria andMailGreaterThan(String value) {
addCriterion("mail >", value, "mail");
return (Criteria) this;
}
public Criteria andMailGreaterThanOrEqualTo(String value) {
addCriterion("mail >=", value, "mail");
return (Criteria) this;
}
public Criteria andMailLessThan(String value) {
addCriterion("mail <", value, "mail");
return (Criteria) this;
}
public Criteria andMailLessThanOrEqualTo(String value) {
addCriterion("mail <=", value, "mail");
return (Criteria) this;
}
public Criteria andMailLike(String value) {
addCriterion("mail like", value, "mail");
return (Criteria) this;
}
public Criteria andMailNotLike(String value) {
addCriterion("mail not like", value, "mail");
return (Criteria) this;
}
public Criteria andMailIn(List<String> values) {
addCriterion("mail in", values, "mail");
return (Criteria) this;
}
public Criteria andMailNotIn(List<String> values) {
addCriterion("mail not in", values, "mail");
return (Criteria) this;
}
public Criteria andMailBetween(String value1, String value2) {
addCriterion("mail between", value1, value2, "mail");
return (Criteria) this;
}
public Criteria andMailNotBetween(String value1, String value2) {
addCriterion("mail not between", value1, value2, "mail");
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion("sex is null");
return (Criteria) this;
......@@ -955,143 +895,133 @@ public class SysUserExample {
return (Criteria) this;
}
public Criteria andOccupationIsNull() {
addCriterion("occupation is null");
return (Criteria) this;
}
public Criteria andOccupationIsNotNull() {
addCriterion("occupation is not null");
return (Criteria) this;
}
public Criteria andOccupationEqualTo(String value) {
addCriterion("occupation =", value, "occupation");
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andOccupationNotEqualTo(String value) {
addCriterion("occupation <>", value, "occupation");
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andOccupationGreaterThan(String value) {
addCriterion("occupation >", value, "occupation");
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationGreaterThanOrEqualTo(String value) {
addCriterion("occupation >=", value, "occupation");
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationLessThan(String value) {
addCriterion("occupation <", value, "occupation");
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationLessThanOrEqualTo(String value) {
addCriterion("occupation <=", value, "occupation");
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationLike(String value) {
addCriterion("occupation like", value, "occupation");
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationNotLike(String value) {
addCriterion("occupation not like", value, "occupation");
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationIn(List<String> values) {
addCriterion("occupation in", values, "occupation");
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationNotIn(List<String> values) {
addCriterion("occupation not in", values, "occupation");
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andOccupationBetween(String value1, String value2) {
addCriterion("occupation between", value1, value2, "occupation");
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andOccupationNotBetween(String value1, String value2) {
addCriterion("occupation not between", value1, value2, "occupation");
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
public Criteria andUserTypeIsNull() {
addCriterion("user_type is null");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
public Criteria andUserTypeIsNotNull() {
addCriterion("user_type is not null");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
public Criteria andUserTypeEqualTo(Byte value) {
addCriterion("user_type =", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
public Criteria andUserTypeNotEqualTo(Byte value) {
addCriterion("user_type <>", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
public Criteria andUserTypeGreaterThan(Byte value) {
addCriterion("user_type >", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
public Criteria andUserTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("user_type >=", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
public Criteria andUserTypeLessThan(Byte value) {
addCriterion("user_type <", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
public Criteria andUserTypeLessThanOrEqualTo(Byte value) {
addCriterion("user_type <=", value, "userType");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
public Criteria andUserTypeIn(List<Byte> values) {
addCriterion("user_type in", values, "userType");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
public Criteria andUserTypeNotIn(List<Byte> values) {
addCriterion("user_type not in", values, "userType");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
public Criteria andUserTypeBetween(Byte value1, Byte value2) {
addCriterion("user_type between", value1, value2, "userType");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
public Criteria andUserTypeNotBetween(Byte value1, Byte value2) {
addCriterion("user_type not between", value1, value2, "userType");
return (Criteria) this;
}
}
......
......@@ -278,7 +278,7 @@ public class OrderServiceImpl implements IOrderService {
Date firstDay = DateUtil.getPastMonthFirstDay(1);
firstDay.setHours(0);
firstDay.setMinutes(0);
firstDay.setSeconds(0);
firstDay.setSeconds(0);
Date lastDay = DateUtil.getPastMonthLastDay(1);
lastDay.setHours(23);
lastDay.setMinutes(59);
......@@ -301,7 +301,7 @@ public class OrderServiceImpl implements IOrderService {
Date pastMonthLast = DateUtil.getPastMonthLastDay(2);
pastMonthLast.setHours(23);
pastMonthLast.setMinutes(59);
pastMonthLast.setSeconds(59);
pastMonthLast.setSeconds(59);
example.clear();
criteria = example.createCriteria().andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0)
.andCreateTimeGreaterThanOrEqualTo(pastMonthFistDay).andCreateTimeLessThanOrEqualTo(pastMonthLast);
......@@ -349,9 +349,13 @@ public class OrderServiceImpl implements IOrderService {
long totalUnfinishedOrders = orderDao.countByExample(example);
criteria.andActiveStatusEqualTo(orderStatus).andCanceledNotEqualTo((byte) 0);
long totalfinishedOrders = orderDao.countByExample(example);
BigDecimal unfinishedRatio = new BigDecimal(totalUnfinishedOrders)
.divide(new BigDecimal(totalfinishedOrders).add(new BigDecimal(totalUnfinishedOrders)))
.setScale(1, BigDecimal.ROUND_HALF_UP);
BigDecimal unfinishedRatio=BigDecimal.ZERO;
if (totalUnfinishedOrders != 0l && new BigDecimal(totalfinishedOrders)
.add(new BigDecimal(totalUnfinishedOrders)).compareTo(BigDecimal.ZERO) != 0) {
unfinishedRatio = new BigDecimal(totalUnfinishedOrders)
.divide(new BigDecimal(totalfinishedOrders).add(new BigDecimal(totalUnfinishedOrders)))
.setScale(1, BigDecimal.ROUND_HALF_UP);
}
unfinishedOrders.setRatio(unfinishedRatio);
unfinishedOrders.setUnfinished(totalUnfinishedOrders);
return unfinishedOrders;
......
<?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.glsx.ordercenter.mapper.SysUserMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.user.SysUser">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="org_id" jdbcType="INTEGER" property="orgId"/>
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber"/>
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="sex" jdbcType="VARCHAR" property="sex"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.user.SysUser">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="org_id" jdbcType="INTEGER" property="orgId" />
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
<result column="user_status" jdbcType="TINYINT" property="userStatus" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="user_type" jdbcType="TINYINT" property="userType" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, username, name, org_id, phone_number, user_status, create_by, create_time, update_by,
update_time, password, sex, remark
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.user.SysUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List"/>
from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
DELETE FROM sys_user
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.ordercenter.pojo.user.SysUserExample">
delete from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_user (username, name, org_id,
phone_number, user_status, create_by,
create_time, update_by, update_time,
password, sex,
remark)
values (#{username,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER},
#{phoneNumber,jdbcType=VARCHAR}, #{userStatus,jdbcType=TINYINT}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{password,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null">
username,
</if>
<if test="name != null">
name,
</if>
<if test="orgId != null">
org_id,
</if>
<if test="phoneNumber != null">
phone_number,
</if>
<if test="userStatus != null">
user_status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="password != null">
password,
</if>
<if test="sex != null">
sex,
</if>
<if test="remark != null">
remark,
</if>
<if test="userType != null">
user_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
</if>
<if test="phoneNumber != null">
#{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
#{userStatus,jdbcType=TINYINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="userType != null">
#{userType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<insert id="insertSysMechanic" parameterType="com.glsx.ordercenter.pojo.user.SysMechanic">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_mechanic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="district != null">
district,
</if>
<if test="address != null">
address,
</if>
<if test="workTimeStart != null">
work_time_start,
</if>
<if test="workTimeEnd != null">
work_time_end,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
<if test="serviceType != null">
service_type,
</if>
<if test="IDCard != null">
IDCard,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="district != null">
#{district,jdbcType=INTEGER},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="workTimeStart != null">
#{workTimeStart,jdbcType=TIMESTAMP},
</if>
<if test="workTimeEnd != null">
#{workTimeEnd,jdbcType=TIMESTAMP},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=INTEGER},
</if>
<if test="serviceType != null">
#{serviceType,jdbcType=INTEGER},
</if>
<if test="IDCard != null">
#{IDCard,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.user.SysUserExample" resultType="java.lang.Long">
select count(*) from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
</if>
<if test="record.phoneNumber != null">
phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
</if>
<if test="record.userStatus != null">
user_status = #{record.userStatus,jdbcType=TINYINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.sex != null">
sex = #{record.sex,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
org_id = #{record.orgId,jdbcType=INTEGER},
phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
user_status = #{record.userStatus,jdbcType=TINYINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
password = #{record.password,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</trim>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
update sys_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
org_id = #{orgId,jdbcType=INTEGER},
</if>
<if test="phoneNumber != null">
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
user_status = #{userStatus,jdbcType=TINYINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
UPDATE sys_user
SET username = #{username,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
org_id = #{orgId,jdbcType=INTEGER},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
user_status = #{userStatus,jdbcType=TINYINT},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
password = #{password,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
WHERE id = #{id,jdbcType=INTEGER}
</update>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, username, name, org_id, phone_number, user_status, create_by, create_time, update_by,
update_time, password, sex, remark, user_type
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.user.SysUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_user (username, name, org_id,
phone_number, user_status, create_by,
create_time, update_by, update_time,
password, sex, remark,
user_type)
values (#{username,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER},
#{phoneNumber,jdbcType=VARCHAR}, #{userStatus,jdbcType=TINYINT}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{password,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{userType,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null">
username,
</if>
<if test="name != null">
name,
</if>
<if test="orgId != null">
org_id,
</if>
<if test="phoneNumber != null">
phone_number,
</if>
<if test="userStatus != null">
user_status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="password != null">
password,
</if>
<if test="sex != null">
sex,
</if>
<if test="remark != null">
remark,
</if>
<if test="userType != null">
user_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
#{orgId,jdbcType=INTEGER},
</if>
<if test="phoneNumber != null">
#{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
#{userStatus,jdbcType=TINYINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="userType != null">
#{userType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.user.SysUserExample" resultType="java.lang.Long">
select count(*) from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
update sys_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="orgId != null">
org_id = #{orgId,jdbcType=INTEGER},
</if>
<if test="phoneNumber != null">
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="userStatus != null">
user_status = #{userStatus,jdbcType=TINYINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="userType != null">
user_type = #{userType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.user.SysUser">
update sys_user
set username = #{username,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
org_id = #{orgId,jdbcType=INTEGER},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
user_status = #{userStatus,jdbcType=TINYINT},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
password = #{password,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
user_type = #{userType,jdbcType=TINYINT}
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!