肖凡3.29代码提交
parent
9a4f24544c
commit
de5ebb32e7
|
@ -90,6 +90,22 @@
|
|||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<!-- mybatis - plus 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.github.jsqlparser</groupId>
|
||||
<artifactId>jsqlparser</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.common.core.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 列表返回结果集
|
||||
* @author XiaoFan
|
||||
* @description: 列表返回结果集
|
||||
*/
|
||||
@Data
|
||||
public class PageResult<T> implements Serializable {
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private long total;
|
||||
/**
|
||||
* 结果集合
|
||||
*/
|
||||
private List<T> list;
|
||||
public PageResult() {
|
||||
}
|
||||
public PageResult(long total, List<T> list) {
|
||||
this.total = total;
|
||||
this.list = list;
|
||||
}
|
||||
public static <T> PageResult<T> toPageResult(long total, List<T> list){
|
||||
return new PageResult(total , list);
|
||||
}
|
||||
public static <T> Result<PageResult<T>> toResult(long total, List<T> list){
|
||||
return Result.success(PageResult.toPageResult(total,list));
|
||||
}
|
||||
}
|
|
@ -3,8 +3,8 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.business.mapper.EnterpriseInfoMapper">
|
||||
|
||||
<resultMap type="EnterpriseInfo" id="EnterpriseInfoResult">
|
||||
|
||||
<resultMap type="com.muyu.business.domain.EnterpriseInfo" id="EnterpriseInfoResult">
|
||||
<result property="enterpriseId" column="enterprise_id" />
|
||||
<result property="enterpriseName" column="enterprise_name" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
|
@ -22,9 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select enterprise_id, enterprise_name, contact_person, contact_email, user_id, enterprise_address, phone_number, industry, employee_count, status, identifier from enterprise_info
|
||||
</sql>
|
||||
|
||||
<select id="selectEnterpriseInfoList" parameterType="EnterpriseInfo" resultMap="EnterpriseInfoResult">
|
||||
<select id="selectEnterpriseInfoList" parameterType="com.muyu.business.domain.EnterpriseInfo" resultMap="EnterpriseInfoResult">
|
||||
<include refid="selectEnterpriseInfoVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactEmail != null and contactEmail != ''"> and contact_email = #{contactEmail}</if>
|
||||
|
@ -37,13 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="identifier != null and identifier != ''"> and identifier = #{identifier}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectEnterpriseInfoByEnterpriseId" parameterType="Long" resultMap="EnterpriseInfoResult">
|
||||
<include refid="selectEnterpriseInfoVo"/>
|
||||
where enterprise_id = #{enterpriseId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEnterpriseInfo" parameterType="EnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
|
||||
|
||||
<insert id="insertEnterpriseInfo" parameterType="com.muyu.business.domain.EnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
|
||||
insert into enterprise_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="enterpriseName != null">enterprise_name,</if>
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEnterpriseInfo" parameterType="EnterpriseInfo">
|
||||
<update id="updateEnterpriseInfo" parameterType="com.muyu.business.domain.EnterpriseInfo">
|
||||
update enterprise_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
||||
|
@ -93,9 +93,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteEnterpriseInfoByEnterpriseIds" parameterType="String">
|
||||
delete from enterprise_info where enterprise_id in
|
||||
delete from enterprise_info where enterprise_id in
|
||||
<foreach item="enterpriseId" collection="array" open="(" separator="," close=")">
|
||||
#{enterpriseId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.gen.mapper.GenTableColumnMapper">
|
||||
|
||||
<resultMap type="GenTableColumn" id="GenTableColumnResult">
|
||||
<resultMap type="com.muyu.gen.domain.GenTableColumn" id="GenTableColumnResult">
|
||||
<id property="columnId" column="column_id" />
|
||||
<result property="tableId" column="table_id" />
|
||||
<result property="columnName" column="column_name" />
|
||||
|
@ -33,7 +33,7 @@
|
|||
select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
|
||||
</sql>
|
||||
|
||||
<select id="selectGenTableColumnListByTableId" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
|
||||
<select id="selectGenTableColumnListByTableId" parameterType="com.muyu.gen.domain.GenTableColumn" resultMap="GenTableColumnResult">
|
||||
<include refid="selectGenTableColumnVo"/>
|
||||
where table_id = #{tableId}
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
|||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
||||
<insert id="insertGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
||||
insert into gen_table_column (
|
||||
<if test="tableId != null and tableId != ''">table_id,</if>
|
||||
<if test="columnName != null and columnName != ''">column_name,</if>
|
||||
|
@ -104,7 +104,7 @@
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateGenTableColumn" parameterType="GenTableColumn">
|
||||
<update id="updateGenTableColumn" parameterType="com.muyu.gen.domain.GenTableColumn">
|
||||
update gen_table_column
|
||||
<set>
|
||||
<if test="columnComment != null">column_comment = #{columnComment},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.gen.mapper.GenTableMapper">
|
||||
|
||||
<resultMap type="GenTable" id="GenTableResult">
|
||||
<resultMap type="com.muyu.gen.domain.GenTable" id="GenTableResult">
|
||||
<id property="tableId" column="table_id" />
|
||||
<result property="tableName" column="table_name" />
|
||||
<result property="databaseName" column="database_name" />
|
||||
|
@ -30,7 +30,7 @@
|
|||
<collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="GenTableColumn" id="GenTableColumnResult">
|
||||
<resultMap type="com.muyu.gen.domain.GenTableColumn" id="GenTableColumnResult">
|
||||
<id property="columnId" column="column_id" />
|
||||
<result property="tableId" column="table_id" />
|
||||
<result property="columnName" column="column_name" />
|
||||
|
@ -59,7 +59,7 @@
|
|||
select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
|
||||
</sql>
|
||||
|
||||
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
||||
<select id="selectGenTableList" parameterType="com.muyu.gen.domain.GenTable" resultMap="GenTableResult">
|
||||
<include refid="selectGenTableVo"/>
|
||||
<where>
|
||||
<if test="tableName != null and tableName != ''">
|
||||
|
@ -77,7 +77,7 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
|
||||
<select id="selectDbTableList" parameterType="com.muyu.gen.domain.GenTable" resultMap="GenTableResult">
|
||||
select table_schema as database_name,table_name, table_comment, create_time, update_time from information_schema.tables
|
||||
where
|
||||
<choose>
|
||||
|
@ -162,7 +162,7 @@
|
|||
where table_schema not in ('information_schema','mysql','performance_schema','sys')
|
||||
</select>
|
||||
|
||||
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
||||
<insert id="insertGenTable" parameterType="com.muyu.gen.domain.GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
||||
insert into gen_table (
|
||||
<if test="databaseName != null">database_name,</if>
|
||||
<if test="tableName != null">table_name,</if>
|
||||
|
@ -200,7 +200,7 @@
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateGenTable" parameterType="GenTable">
|
||||
<update id="updateGenTable" parameterType="com.muyu.gen.domain.GenTable">
|
||||
update gen_table
|
||||
<set>
|
||||
<if test="tableName != null">table_name = #{tableName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.job.mapper.SysJobLogMapper">
|
||||
|
||||
<resultMap type="SysJobLog" id="SysJobLogResult">
|
||||
<resultMap type="com.muyu.job.domain.SysJobLog" id="SysJobLogResult">
|
||||
<id property="jobLogId" column="job_log_id" />
|
||||
<result property="jobName" column="job_name" />
|
||||
<result property="jobGroup" column="job_group" />
|
||||
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_job_log
|
||||
</sql>
|
||||
|
||||
<select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult">
|
||||
<select id="selectJobLogList" parameterType="com.muyu.job.domain.SysJobLog" resultMap="SysJobLogResult">
|
||||
<include refid="selectJobLogVo"/>
|
||||
<where>
|
||||
<if test="jobName != null and jobName != ''">
|
||||
|
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
truncate table sys_job_log
|
||||
</update>
|
||||
|
||||
<insert id="insertJobLog" parameterType="SysJobLog">
|
||||
<insert id="insertJobLog" parameterType="com.muyu.job.domain.SysJobLog">
|
||||
insert into sys_job_log(
|
||||
<if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
|
||||
<if test="jobName != null and jobName != ''">job_name,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.job.mapper.SysJobMapper">
|
||||
|
||||
<resultMap type="SysJob" id="SysJobResult">
|
||||
<resultMap type="com.muyu.job.domain.SysJob" id="SysJobResult">
|
||||
<id property="jobId" column="job_id" />
|
||||
<result property="jobName" column="job_name" />
|
||||
<result property="jobGroup" column="job_group" />
|
||||
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_job
|
||||
</sql>
|
||||
|
||||
<select id="selectJobList" parameterType="SysJob" resultMap="SysJobResult">
|
||||
<select id="selectJobList" parameterType="com.muyu.job.domain.SysJob" resultMap="SysJobResult">
|
||||
<include refid="selectJobVo"/>
|
||||
<where>
|
||||
<if test="jobName != null and jobName != ''">
|
||||
|
@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateJob" parameterType="SysJob">
|
||||
<update id="updateJob" parameterType="com.muyu.job.domain.SysJob">
|
||||
update sys_job
|
||||
<set>
|
||||
<if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
|
||||
|
@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where job_id = #{jobId}
|
||||
</update>
|
||||
|
||||
<insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId">
|
||||
<insert id="insertJob" parameterType="com.muyu.job.domain.SysJob" useGeneratedKeys="true" keyProperty="jobId">
|
||||
insert into sys_job(
|
||||
<if test="jobId != null and jobId != 0">job_id,</if>
|
||||
<if test="jobName != null and jobName != ''">job_name,</if>
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.system.common.domain.req.CarAddReq;
|
||||
import com.muyu.system.common.domain.req.CarUpdateReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆管理表 car
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/28 21:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("car")
|
||||
public class Car {
|
||||
@TableId(value = "car_id",type = IdType.AUTO)
|
||||
/**
|
||||
* 车辆表ID
|
||||
*/
|
||||
private Integer carId;
|
||||
/**
|
||||
* 车辆表vin
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
private Integer carType;
|
||||
/**
|
||||
* 电子围栏ID
|
||||
*/
|
||||
private Integer carFenceId;
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
private Integer state;
|
||||
/**
|
||||
* 电机厂商
|
||||
*/
|
||||
private String carElectricalmachiney;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
private String carBattery;
|
||||
/**
|
||||
* 电机编号
|
||||
*/
|
||||
private Integer carElectricalmachineyId;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
private Integer carBatteryId;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
public static Car addReqBuild(CarAddReq carAddReq){
|
||||
return Car.builder()
|
||||
.carVin(carAddReq.getCarVin())
|
||||
.carType(carAddReq.getCarType())
|
||||
.carFenceId(carAddReq.getCarFenceId())
|
||||
.state(carAddReq.getState())
|
||||
.carElectricalmachiney(carAddReq.getCarElectricalmachiney())
|
||||
.carBattery(carAddReq.getCarBattery())
|
||||
.carElectricalmachineyId(carAddReq.getCarElectricalmachineyId())
|
||||
.carBatteryId(carAddReq.getCarBatteryId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Car updateReqBuild(CarUpdateReq carUpdateReq){
|
||||
return Car.builder()
|
||||
.carId(carUpdateReq.getCarId())
|
||||
.carVin(carUpdateReq.getCarVin())
|
||||
.carType(carUpdateReq.getCarType())
|
||||
.carFenceId(carUpdateReq.getCarFenceId())
|
||||
.state(carUpdateReq.getState())
|
||||
.carElectricalmachiney(carUpdateReq.getCarElectricalmachiney())
|
||||
.carBattery(carUpdateReq.getCarBattery())
|
||||
.carElectricalmachineyId(carUpdateReq.getCarElectricalmachineyId())
|
||||
.carBatteryId(carUpdateReq.getCarBatteryId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆上线记录 car_info
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/26 19:46
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CarInfo extends BaseEntity{
|
||||
/**
|
||||
* 日志表ID
|
||||
*/
|
||||
private Integer logId;
|
||||
/**
|
||||
* 车辆表vin
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 上线时间
|
||||
*/
|
||||
private Date logDate;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.system.common.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 电子围栏实体类 Fence
|
||||
* @ClassName Fence
|
||||
* @Description 电子围栏实体类
|
||||
* @Author YinYuYang
|
||||
* @Date 2024/3/26 20:48
|
||||
* Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("fence_info")
|
||||
public class Fence{
|
||||
|
||||
/**
|
||||
* 围栏ID
|
||||
*/
|
||||
@TableId(value = "fence_id", type = IdType.AUTO)
|
||||
private Integer fenceId;
|
||||
|
||||
/**
|
||||
* 围栏编码
|
||||
*/
|
||||
@TableField("fence_encoding")
|
||||
private String fenceEncoding;
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
@TableField("fence_name")
|
||||
private String fenceName;
|
||||
|
||||
/**
|
||||
* 围栏类型
|
||||
*/
|
||||
@TableField("fence_type")
|
||||
private Integer fenceType;
|
||||
|
||||
/**
|
||||
* 围栏状态
|
||||
*/
|
||||
@TableField("fence_state")
|
||||
private Integer fenceState;
|
||||
|
||||
/**
|
||||
* 经纬度信息
|
||||
*/
|
||||
@TableField("fence_radius")
|
||||
private String fenceRadius;
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.system.common.domain.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 车辆表添加
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain.req
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/29 19:04
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "请求参数")
|
||||
public class CarAddReq {
|
||||
/**
|
||||
* 车俩表vin
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[0-9a-zA-Z]{17}$",message = "请输入正确的vin码")
|
||||
@ApiModelProperty(value = "车辆vin码")
|
||||
private String carVin;
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "车辆类型必须大于等于1")
|
||||
@ApiModelProperty(value = "车辆类型")
|
||||
private Integer carType;
|
||||
/**
|
||||
* 电子围栏ID
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电子围栏必须大于等于1")
|
||||
@ApiModelProperty(value = "电子围栏ID")
|
||||
private Integer carFenceId;
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "车辆状态必须大于等于1")
|
||||
@ApiModelProperty(value = "车辆状态")
|
||||
private Integer state;
|
||||
/**
|
||||
* 电机厂商
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$",message = "请输入正确的电机厂商")
|
||||
@ApiModelProperty(value = "电机厂商")
|
||||
private String carElectricalmachiney;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$",message = "请输入正确的电池厂商")
|
||||
@ApiModelProperty(value = "电池厂商")
|
||||
private String carBattery;
|
||||
/**
|
||||
* 电机编号
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电机编号必须大于等于1")
|
||||
@ApiModelProperty(value = "电机编号")
|
||||
private Integer carElectricalmachineyId;
|
||||
/**
|
||||
* 电池编号
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电池编号必须大于等于1")
|
||||
@ApiModelProperty(value = "电池编号")
|
||||
private Integer carBatteryId;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.system.common.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 列表分页参数
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain.req
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/29 19:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CarRequest {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.muyu.system.common.domain.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 车辆表修改
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain.req
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/29 19:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "请求参数")
|
||||
public class CarUpdateReq {
|
||||
/**
|
||||
* 车辆表id
|
||||
*/
|
||||
@ApiModelProperty(value = "车辆表id")
|
||||
private Integer carId;
|
||||
/**
|
||||
* 车俩表vin
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[0-9a-zA-Z]{17}$",message = "请输入正确的vin码")
|
||||
@ApiModelProperty(value = "车辆vin码")
|
||||
private String carVin;
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "车辆类型必须大于等于1")
|
||||
@ApiModelProperty(value = "车辆类型")
|
||||
private Integer carType;
|
||||
/**
|
||||
* 电子围栏ID
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电子围栏必须大于等于1")
|
||||
@ApiModelProperty(value = "电子围栏ID")
|
||||
private Integer carFenceId;
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "车辆状态必须大于等于1")
|
||||
@ApiModelProperty(value = "车辆状态")
|
||||
private Integer state;
|
||||
/**
|
||||
* 电机厂商
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$",message = "请输入正确的电机厂商")
|
||||
@ApiModelProperty(value = "电机厂商")
|
||||
private String carElectricalmachiney;
|
||||
/**
|
||||
* 电池厂商
|
||||
*/
|
||||
@NotEmpty
|
||||
@Length(max = 255)
|
||||
@Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$",message = "请输入正确的电池厂商")
|
||||
@ApiModelProperty(value = "电池厂商")
|
||||
private String carBattery;
|
||||
/**
|
||||
* 电机编号
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电机编号必须大于等于1")
|
||||
@ApiModelProperty(value = "电机编号")
|
||||
private Integer carElectricalmachineyId;
|
||||
/**
|
||||
* 电池编号
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 1, message = "电池编号必须大于等于1")
|
||||
@ApiModelProperty(value = "电池编号")
|
||||
private Integer carBatteryId;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.system.common.domain.vo;
|
||||
|
||||
import com.muyu.system.common.domain.req.CarRequest;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 列表条件查询参数
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain.vo
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/29 19:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "请求参数")
|
||||
public class CarVo extends CarRequest {
|
||||
@ApiModelProperty(value = "车辆vin码")
|
||||
private String carVin;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -22,6 +22,12 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-system-common</artifactId>
|
||||
</dependency>
|
||||
<!-- 引入swagger-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.system;
|
|||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableRyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
@ -15,6 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.muyu.system.mapper")
|
||||
public class MuYuSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.SysDictData;
|
||||
import com.muyu.system.common.domain.req.CarAddReq;
|
||||
import com.muyu.system.common.domain.req.CarUpdateReq;
|
||||
import com.muyu.system.common.domain.vo.CarVo;
|
||||
import com.muyu.system.service.CarService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆管理
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.controller
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/26 19:57
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/car")
|
||||
public class CarController extends BaseController{
|
||||
@Autowired
|
||||
private CarService carService;
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("system:car:list")
|
||||
@Log(title = "车辆列表")
|
||||
public Result<PageResult<Car>> list(@Validated CarVo carVo){
|
||||
log.info("执行操作:查询车辆列表,请求URL:{},请求方法:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(), carVo);
|
||||
Result<PageResult<Car>> list=carService.list(carVo);
|
||||
log.info("执行操作:查询车辆列表,请求URL:{},请求方式:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(list));
|
||||
return list;
|
||||
}
|
||||
@PostMapping("/add")
|
||||
@RequiresPermissions("system:config:add")
|
||||
@Log(title = "车辆管理",businessType = BusinessType.INSERT)
|
||||
public Result add(@RequestBody @Validated CarAddReq carAddReq){
|
||||
log.info("执行操作:添加车辆数据,请求URL:{},请求方式:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(carAddReq));
|
||||
Result result=Result.success(carAddReq);
|
||||
carService.add(Car.addReqBuild(carAddReq));
|
||||
log.info("执行操作:添加车辆数据,请求URL:{},请求方式:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(carAddReq));
|
||||
return result;
|
||||
}
|
||||
@PostMapping("/update")
|
||||
@RequiresPermissions("system:config:edit")
|
||||
@Log(title = "车辆管理",businessType = BusinessType.UPDATE)
|
||||
public Result update(@RequestBody @Validated CarUpdateReq carUpdateReq){
|
||||
log.info("执行操作:修改车辆数据,请求URL:{},请求方式:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(carUpdateReq));
|
||||
Result result=Result.success(carUpdateReq);
|
||||
carService.update(Car.updateReqBuild(carUpdateReq));
|
||||
log.info("执行操作:修改车辆数据,请求URL:{},请求方式:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
@PostMapping("/del/{carId}")
|
||||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "车辆管理",businessType = BusinessType.DELETE)
|
||||
public Result del(@PathVariable Integer carId){
|
||||
log.info("执行操作:删除,请求URL:{},请求方式:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(carId));
|
||||
Result result=Result.success(carId);
|
||||
carService.del(carId);
|
||||
log.info("执行操作:删除,请求URL:{},请求方式:{},响应结果:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
@GetMapping("/findById/{carId}")
|
||||
@RequiresPermissions("system:car:query")
|
||||
@Log(title = "车辆管理")
|
||||
public Car findById(@PathVariable Integer carId){
|
||||
log.info("执行操作:根据id查询数据,请求URL:{},请求方式:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(),JSONObject.toJSONString(carId));
|
||||
Car car=carService.findById(carId);
|
||||
log.info("执行操作:根据id查询数据,请求URL:{},请求方式:{},请求参数:{}",request.getRequestURI(),
|
||||
request.getMethod(), JSONObject.toJSONString(car));
|
||||
return car;
|
||||
}
|
||||
@GetMapping("/selectFence")
|
||||
@Log(title = "查询电子围栏表")
|
||||
public Result<List<Fence>> selectFence(){
|
||||
log.info("执行操作:根据id查询电子围栏表,请求URL:{},请求方式:{}",request.getRequestURI(),
|
||||
request.getMethod());
|
||||
List<Fence> list=carService.selectFence();
|
||||
return Result.success(list);
|
||||
}
|
||||
@GetMapping("/selectState")
|
||||
@Log(title = "查询字典表")
|
||||
public Result<List<SysDictData>> selectState(){
|
||||
log.info("执行操作:查询规则,请求URL:{},请求方式:{}",request.getRequestURI(),
|
||||
request.getMethod());
|
||||
List<SysDictData> list=carService.selectState();
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.SysDictData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆管理 数据层
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.mapper
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/26 19:59
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarMapper extends BaseMapper<Car> {
|
||||
List<SysDictData> selectState();
|
||||
|
||||
List<Fence> selectFence();
|
||||
|
||||
|
||||
|
||||
// List<Car> list(carVo carVo);
|
||||
|
||||
// void add(Car car);
|
||||
//
|
||||
//void update(car car);
|
||||
//
|
||||
// void del(Integer carId);
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.SysDictData;
|
||||
import com.muyu.system.common.domain.vo.CarVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆管理 服务层
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.service
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/26 19:58
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface CarService extends IService<Car> {
|
||||
Result<PageResult<Car>> list(CarVo carVo);
|
||||
|
||||
|
||||
void add(Car car);
|
||||
|
||||
void update(Car car);
|
||||
|
||||
void del(Integer carId);
|
||||
|
||||
|
||||
Car findById(Integer carId);
|
||||
|
||||
List<SysDictData> selectState();
|
||||
|
||||
|
||||
|
||||
List<Fence> selectFence();
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.uuid.IdUtils;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.SysDictData;
|
||||
import com.muyu.system.common.domain.vo.CarVo;
|
||||
import com.muyu.system.mapper.CarMapper;
|
||||
import com.muyu.system.service.CarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆管理 业务层
|
||||
* @ProjectName: colud-vehicles
|
||||
* @PackageName: com.muyu.system.service.impl
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/26 19:58
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarService {
|
||||
@Autowired
|
||||
private CarMapper carMapper;
|
||||
|
||||
@Override
|
||||
public Result<PageResult<Car>> list(CarVo carVo) {
|
||||
PageHelper.startPage(carVo.getPageNum(),carVo.getPageSize());
|
||||
LambdaQueryWrapper<Car> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//判断一个字符串是否为空字符串
|
||||
if (StringUtils.isNotEmpty(carVo.getCarVin())){
|
||||
lambdaQueryWrapper.like(Car::getCarVin,carVo.getCarVin());
|
||||
}
|
||||
List<Car> list=this.list(lambdaQueryWrapper);
|
||||
PageInfo<Car> info = new PageInfo<>(list);
|
||||
return PageResult.toResult(info.getTotal(),info.getList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Car car) {
|
||||
car.setCarVin("vin"+IdUtils.fastSimpleUUID());
|
||||
carMapper.insert(car);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Car car) {
|
||||
carMapper.updateById(car);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(Integer carId) {
|
||||
carMapper.deleteById(carId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Car findById(Integer carId) {
|
||||
return carMapper.selectById(carId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDictData> selectState() {
|
||||
return carMapper.selectState();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<Fence> selectFence() {
|
||||
return carMapper.selectFence();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
<?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.muyu.system.mapper.CarMapper">
|
||||
|
||||
<!-- <resultMap type="com.muyu.system.common.domain.Car" id="list">-->
|
||||
<!-- <id property="carId" column="cat_id"></id>-->
|
||||
<!-- <result property="carVin" column="car_vin"></result>-->
|
||||
<!-- <result property="carType" column="car_type"></result>-->
|
||||
<!-- <result property="carFenceId" column="car_fence_id"></result>-->
|
||||
<!-- <result property="carState" column="car_state"></result>-->
|
||||
<!-- <result property="carElectricalmachiney" column="car_electricalmachiney"></result>-->
|
||||
<!-- <result property="carBattery" column="car_battery"></result>-->
|
||||
<!-- <result property="carElectricalmachineyId" column="car_electricalmachiney_id"></result>-->
|
||||
<!-- <result property="carBatteryId" column="car_battery_id"></result>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<!-- <insert id="add">-->
|
||||
<!-- insert into t_car(-->
|
||||
<!-- <if test="carVin!=null and carVin!=''">car_vin,</if>-->
|
||||
<!-- <if test="carType!=null">car_type,</if>-->
|
||||
<!-- <if test="carFenceId!=null">car_fence_id,</if>-->
|
||||
<!-- <if test="carState!=null">car_state,</if>-->
|
||||
<!-- <if test="carElectricalmachiney!=null and carElectricalmachiney!=''">car_electricalmachiney,</if>-->
|
||||
<!-- <if test="carBattery!=null and carBattery!=''">car_battery,</if>-->
|
||||
<!-- <if test="carElectricalmachineyId!=null">car_electricalmachiney_id,</if>-->
|
||||
<!-- <if test="carBatteryId!=null">car_battery_id</if>-->
|
||||
<!-- )values (-->
|
||||
<!-- <if test="carVin!=null and carVin!=''">#{carVin,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carType!=null">#{carType,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carFenceId!=null">#{carFenceId,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carState!=null">#{carState,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carElectricalmachiney!=null and carElectricalmachiney!=''">#{carElectricalmachiney,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carBattery!=null and carBattery!=''">#{carBattery,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carElectricalmachineyId!=null">#{carElectricalmachineyId,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carBatteryId!=null">#{carBatteryId,jdbcType=BIGINT}</if>-->
|
||||
<!-- )-->
|
||||
<!-- </insert>-->
|
||||
<!-- <update id="update">-->
|
||||
<!-- update t_car set-->
|
||||
<!-- <if test="carVin!=null and carVin!=''">car_vin=#{carVin,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carType!=null">car_type=#{carType,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carFenceId!=null">car_fence_id=#{carFenceId,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carState!=null">car_state=#{carState,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carElectricalmachiney!=null and carElectricalmachiney!=''">car_electricalmachiney=#{carElectricalmachiney,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carBattery!=null and carBattery!=''">car_battery=#{carBattery,jdbcType=VARCHAR},</if>-->
|
||||
<!-- <if test="carElectricalmachineyId!=null">car_electricalmachiney_id=#{carElectricalmachineyId,jdbcType=BIGINT},</if>-->
|
||||
<!-- <if test="carBatteryId!=null">car_battery_id=#{carBatteryId,jdbcType=BIGINT}</if>-->
|
||||
<!-- where-->
|
||||
<!-- <if test="carId!=null">car_id=#{carId,jdbcType=BIGINT}</if>-->
|
||||
<!-- </update>-->
|
||||
<!-- <delete id="del">-->
|
||||
<!-- delete from t_car-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="carId!=null">car_id=#{carId,jdbcType=BIGINT}</if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </delete>-->
|
||||
|
||||
<!-- <select id="list" parameterType="com.muyu.system.common.domain.Car" resultMap="list">-->
|
||||
<!-- <include refid="list"></include>-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="carVin!=null and carVin!=''">-->
|
||||
<!-- and car_vin like concat('%',#{carVin},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carType!=null">-->
|
||||
<!-- and car_type = #{carType}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carFenceId!=null">-->
|
||||
<!-- and car_fence_id=#{carFenceId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carState!=null">-->
|
||||
<!-- and car_state=#{carState}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carElectricalmachiney!=null and carElectricalmachiney!=''">-->
|
||||
<!-- and car_electricalmachiney like concat('%',#{carElectricalmachiney},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carBattery!=null and carBattery!=''">-->
|
||||
<!-- and car_battery like concat('%',#{carBattery},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carElectricalmachineyId!=null">-->
|
||||
<!-- and car_electricalmachiney_id=#{carElectricalmachineyId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="carBatteryId!=null">-->
|
||||
<!-- and car_battery_id=#{carBatteryId}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <sql id="list">-->
|
||||
<!-- select car_id,car_vin,car_type,car_fence_id,car_state,-->
|
||||
<!-- car_electricalmachiney,car_battery,-->
|
||||
<!-- car_electricalmachiney_id,car_battery_id-->
|
||||
<!-- from t_car-->
|
||||
<!-- </sql>-->
|
||||
|
||||
<select id="selectState" resultType="com.muyu.system.common.domain.SysDictData">
|
||||
select dict_value,dict_label from sys_dict_data where dict_type='car_state'
|
||||
</select>
|
||||
<select id="selectFence" resultType="com.muyu.system.common.domain.Fence">
|
||||
select fence_id,fence_name from t_fence
|
||||
</select>
|
||||
</mapper>
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
|
@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfig" parameterType="com.muyu.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfigList" parameterType="com.muyu.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
<insert id="insertConfig" parameterType="com.muyu.system.common.domain.SysConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
|
@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
<update id="updateConfig" parameterType="com.muyu.system.common.domain.SysConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<select id="selectDeptList" parameterType="com.muyu.system.common.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
|
@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
<insert id="insertDept" parameterType="com.muyu.system.common.domain.SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
<update id="updateDept" parameterType="com.muyu.system.common.domain.SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysDictDataMapper">
|
||||
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataList" parameterType="com.muyu.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataByType" parameterType="com.muyu.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
<update id="updateDictData" parameterType="com.muyu.system.common.domain.SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
<insert id="insertDictData" parameterType="com.muyu.system.common.domain.SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<select id="selectDictTypeList" parameterType="com.muyu.system.common.domain.SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
<update id="updateDictType" parameterType="com.muyu.system.common.domain.SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
|
@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
<insert id="insertDictType" parameterType="com.muyu.system.common.domain.SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysLogininforMapper">
|
||||
|
||||
<resultMap type="SysLogininfor" id="SysLogininforResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysLogininfor" id="SysLogininforResult">
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="status" column="status" />
|
||||
|
@ -13,12 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="accessTime" column="access_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||
<insert id="insertLogininfor" parameterType="com.muyu.system.common.domain.SysLogininfor">
|
||||
insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
|
||||
values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||
<select id="selectLogininforList" parameterType="com.muyu.system.common.domain.SysLogininfor" resultMap="SysLogininforResult">
|
||||
select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
|
||||
<where>
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysMenuMapper">
|
||||
|
||||
<resultMap type="SysMenu" id="SysMenuResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysMenu" id="SysMenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
|
@ -32,7 +32,7 @@
|
|||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuList" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
|
@ -54,7 +54,7 @@
|
|||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuListByUserId" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
|
@ -127,12 +127,12 @@
|
|||
select count(1) from sys_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="checkMenuNameUnique" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
<update id="updateMenu" parameterType="com.muyu.system.common.domain.SysMenu">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
|
@ -155,7 +155,7 @@
|
|||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
<insert id="insertMenu" parameterType="com.muyu.system.common.domain.SysMenu">
|
||||
insert into sys_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysNoticeMapper">
|
||||
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<select id="selectNoticeList" parameterType="com.muyu.system.common.domain.SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
<insert id="insertNotice" parameterType="com.muyu.system.common.domain.SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
<update id="updateNotice" parameterType="com.muyu.system.common.domain.SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysOperLogMapper">
|
||||
|
||||
<resultMap type="SysOperLog" id="SysOperLogResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysOperLog" id="SysOperLogResult">
|
||||
<id property="operId" column="oper_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="businessType" column="business_type" />
|
||||
|
@ -28,12 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
<insert id="insertOperlog" parameterType="com.muyu.system.common.domain.SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<select id="selectOperLogList" parameterType="com.muyu.system.common.domain.SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
|
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<select id="selectPostList" parameterType="com.muyu.system.common.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
<update id="updatePost" parameterType="com.muyu.system.common.domain.SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
|
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
<insert id="insertPost" parameterType="com.muyu.system.common.domain.SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysRoleDeptMapper">
|
||||
|
||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysRoleDept" id="SysRoleDeptResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<select id="selectRoleList" parameterType="com.muyu.system.common.domain.SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
<insert id="insertRole" parameterType="com.muyu.system.common.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
|
@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRole" parameterType="SysRole">
|
||||
<update id="updateRole" parameterType="com.muyu.system.common.domain.SysRole">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysRoleMenuMapper">
|
||||
|
||||
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysRoleMenu" id="SysRoleMenuResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
|
@ -23,11 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<association property="dept" javaType="com.muyu.system.common.domain.SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<resultMap id="deptResult" type="com.muyu.system.common.domain.SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<resultMap id="RoleResult" type="com.muyu.system.common.domain.SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
|
@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectUserList" parameterType="com.muyu.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
|
@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectAllocatedList" parameterType="com.muyu.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
|
@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectUnallocatedList" parameterType="com.muyu.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
|
@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
<insert id="insertUser" parameterType="com.muyu.system.common.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
|
@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
<update id="updateUser" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -195,15 +195,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
<update id="updateUserStatus" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
<update id="updateUserAvatar" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
<update id="resetUserPwd" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysUserPostMapper">
|
||||
|
||||
<resultMap type="SysUserPost" id="SysUserPostResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysUserPost" id="SysUserPostResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
</resultMap>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysUserRoleMapper">
|
||||
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
<delete id="deleteUserRoleInfo" parameterType="com.muyu.system.common.domain.SysUserRole">
|
||||
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
|
|
Loading…
Reference in New Issue