5 changed files with 478 additions and 0 deletions
-
76src/main/java/com/gaotao/modules/app/dao/DepartmentMapper.java
-
39src/main/java/com/gaotao/modules/app/entity/DepartmentData.java
-
38src/main/java/com/gaotao/modules/toolman/entity/WareHouseData.java
-
161src/main/resources/mapper/app/DepartmentMapper.xml
-
164src/main/resources/mapper/toolman/WareHouseMapper.xml
@ -0,0 +1,76 @@ |
|||
package com.gaotao.modules.app.dao; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.gaotao.modules.app.entity.DepartmentData; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @Auther: Zuowenwen |
|||
* @Date:2021/10/27 14:03 |
|||
* @Description: //TODO 描述 |
|||
*/ |
|||
@Mapper |
|||
public interface DepartmentMapper { |
|||
|
|||
/** |
|||
* @Method getDepartmentList |
|||
* @Description: 根据条件 获取部门信息 |
|||
* @author zuowenwen |
|||
* @Version 1.0 |
|||
* @param departmentData |
|||
* @return |
|||
* @throws |
|||
* @date 2021/10/27 |
|||
*/ |
|||
List<DepartmentData> getDepartmentList(DepartmentData departmentData); |
|||
|
|||
/** |
|||
* @Method insertSelective |
|||
* @Description: 新增部门信息 |
|||
* @author zuowenwen |
|||
* @Version 1.0 |
|||
* @param departmentData |
|||
* @return |
|||
* @throws |
|||
* @date 2021/10/27 |
|||
*/ |
|||
int insertSelective(DepartmentData departmentData); |
|||
|
|||
/** |
|||
* @Method insertList |
|||
* @Description: 批量新增部门信息 |
|||
* @author zuowenwen |
|||
* @Version 1.0 |
|||
* @param list |
|||
* @return |
|||
* @throws |
|||
* @date 2021/10/27 |
|||
*/ |
|||
int insertList(@Param("list") List<DepartmentData> list); |
|||
|
|||
/** |
|||
* @Method updateDepartment |
|||
* @Description: 更改 部门信息 |
|||
* @author zuowenwen |
|||
* @Version 1.0 |
|||
* @param departmentData |
|||
* @return |
|||
* @throws |
|||
* @date 2021/10/27 |
|||
*/ |
|||
int updateDepartment(DepartmentData departmentData); |
|||
|
|||
/** |
|||
* @Method deleteDepartment |
|||
* @Description: 删除 部门信息 |
|||
* @author zuowenwen |
|||
* @Version 1.0 |
|||
* @param departmentData |
|||
* @return |
|||
* @throws |
|||
* @date 2021/10/27 |
|||
*/ |
|||
int deleteDepartment(DepartmentData departmentData); |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
package com.gaotao.modules.app.entity; |
|||
import lombok.Data; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author ZuoWen |
|||
* @Date 2021-10-27 |
|||
*/ |
|||
|
|||
@Data |
|||
public class DepartmentData { |
|||
|
|||
|
|||
/** 主键id */ |
|||
private Integer id; |
|||
/** 工厂编号 */ |
|||
private String site; |
|||
/** 部门编码 */ |
|||
private String departmentNo; |
|||
/** 部门名称 */ |
|||
private String departmentDesc; |
|||
/** 状态 */ |
|||
private String active; |
|||
/** 创建人 */ |
|||
private String createdBy; |
|||
/** 创建时间 */ |
|||
private Date createdDate; |
|||
/** 备注 */ |
|||
private String remark; |
|||
/** 更改人 */ |
|||
private String updateBy; |
|||
/** 更改时间 */ |
|||
private Date updatedDate; |
|||
/** 是否删除 */ |
|||
private String delflag; |
|||
/** 版本号 */ |
|||
private Integer version; |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package com.gaotao.modules.toolman.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author ZuoWen |
|||
* @Date 2021-10-27 |
|||
*/ |
|||
@Data |
|||
public class WareHouseData { |
|||
|
|||
|
|||
/** 工厂编码 */ |
|||
private String site; |
|||
/** 仓库id */ |
|||
private String wareHouseId; |
|||
/** 仓库名称 */ |
|||
private String wareHouseName; |
|||
/** 是否启用 */ |
|||
private String active; |
|||
/** 仓库类型 */ |
|||
private String wareHouseType; |
|||
/** 仓库类型 */ |
|||
private String wareHouseTypeDb; |
|||
/** 管理人 */ |
|||
private String keeper; |
|||
/** 公司编码 */ |
|||
private String companyId; |
|||
/** 是否有效 */ |
|||
private String validStock; |
|||
/** 使用库位 */ |
|||
private String useLocation; |
|||
|
|||
private String strActive; |
|||
|
|||
private Integer id; |
|||
} |
|||
@ -0,0 +1,161 @@ |
|||
<?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.gaotao.modules.app.dao.DepartmentMapper"> |
|||
<resultMap id="BaseResultMap" type="com.gaotao.modules.app.entity.DepartmentData"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table department--> |
|||
<result column="id" jdbcType="INTEGER" property="id" /> |
|||
<result column="site" jdbcType="VARCHAR" property="site" /> |
|||
<result column="department_no" jdbcType="VARCHAR" property="departmentNo" /> |
|||
<result column="department_desc" jdbcType="VARCHAR" property="departmentDesc" /> |
|||
<result column="active" jdbcType="CHAR" property="active" /> |
|||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" /> |
|||
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" /> |
|||
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
|||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
|||
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" /> |
|||
<result column="delflag" jdbcType="CHAR" property="delflag" /> |
|||
<result column="version" jdbcType="INTEGER" property="version" /> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
id, site, department_no, department_desc, active, created_by, created_date, remark, |
|||
update_by, updated_date, delflag, version |
|||
</sql> |
|||
<select id="getDepartmentList" resultMap="BaseResultMap"> |
|||
<!--@mbg.generated--> |
|||
select |
|||
<include refid="Base_Column_List"/> |
|||
from department |
|||
<where> |
|||
<if test="site != null"> |
|||
and site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="active != null"> |
|||
and active=#{active,jdbcType=CHAR} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<insert id="insertSelective"> |
|||
<!--@mbg.generated--> |
|||
INSERT INTO department |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id!=null">id,</if> |
|||
<if test="site!=null">site,</if> |
|||
<if test="departmentNo!=null">department_no,</if> |
|||
<if test="departmentDesc!=null">department_desc,</if> |
|||
<if test="active!=null">active,</if> |
|||
<if test="createdBy!=null">created_by,</if> |
|||
<if test="createdDate!=null">created_date,</if> |
|||
<if test="remark!=null">remark,</if> |
|||
<if test="updateBy!=null">update_by,</if> |
|||
<if test="updatedDate!=null">updated_date,</if> |
|||
<if test="delflag!=null">delflag,</if> |
|||
<if test="version!=null">version</if> |
|||
</trim> |
|||
VALUES |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id!=null">#{id,jdbcType=INTEGER},</if> |
|||
<if test="site!=null">#{site,jdbcType=VARCHAR},</if> |
|||
<if test="departmentNo!=null">#{departmentNo,jdbcType=VARCHAR},</if> |
|||
<if test="departmentDesc!=null">#{departmentDesc,jdbcType=VARCHAR},</if> |
|||
<if test="active!=null">#{active,jdbcType=CHAR},</if> |
|||
<if test="createdBy!=null">#{createdBy,jdbcType=VARCHAR},</if> |
|||
<if test="createdDate!=null">#{createdDate,jdbcType=TIMESTAMP},</if> |
|||
<if test="remark!=null">#{remark,jdbcType=VARCHAR},</if> |
|||
<if test="updateBy!=null">#{updateBy,jdbcType=VARCHAR},</if> |
|||
<if test="updatedDate!=null">#{updatedDate,jdbcType=TIMESTAMP},</if> |
|||
<if test="delflag!=null">#{delflag,jdbcType=CHAR},</if> |
|||
<if test="version!=null">#{version,jdbcType=INTEGER}</if> |
|||
</trim> |
|||
</insert> |
|||
<insert id="insertList"> |
|||
<!--@mbg.generated--> |
|||
INSERT INTO department( |
|||
id, |
|||
site, |
|||
department_no, |
|||
department_desc, |
|||
active, |
|||
created_by, |
|||
created_date, |
|||
remark, |
|||
update_by, |
|||
updated_date, |
|||
delflag, |
|||
version |
|||
)VALUES |
|||
<foreach collection="list" item="element" index="index" separator=","> |
|||
( |
|||
#{element.id,jdbcType=INTEGER}, |
|||
#{element.site,jdbcType=VARCHAR}, |
|||
#{element.departmentNo,jdbcType=VARCHAR}, |
|||
#{element.departmentDesc,jdbcType=VARCHAR}, |
|||
#{element.active,jdbcType=CHAR}, |
|||
#{element.createdBy,jdbcType=VARCHAR}, |
|||
#{element.createdDate,jdbcType=TIMESTAMP}, |
|||
#{element.remark,jdbcType=VARCHAR}, |
|||
#{element.updateBy,jdbcType=VARCHAR}, |
|||
#{element.updatedDate,jdbcType=TIMESTAMP}, |
|||
#{element.delflag,jdbcType=CHAR}, |
|||
#{element.version,jdbcType=INTEGER} |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
<update id="updateDepartment"> |
|||
<!--@mbg.generated--> |
|||
update department |
|||
<set> |
|||
<if test="departmentDesc != null and departmentDesc != ''"> |
|||
department_desc = #{departmentDesc,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="active != null"> |
|||
active = #{active,jdbcType=CHAR}, |
|||
</if> |
|||
<if test="createdBy != null"> |
|||
created_by = #{createdBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createdDate != null"> |
|||
created_date = #{createdDate,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="remark != null"> |
|||
remark = #{remark,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="updateBy != null"> |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="updatedDate != null"> |
|||
updated_date = #{updatedDate,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="delflag != null"> |
|||
delflag = #{delflag,jdbcType=CHAR}, |
|||
</if> |
|||
<if test="version != null"> |
|||
version = #{version,jdbcType=INTEGER}, |
|||
</if> |
|||
</set> |
|||
<where> |
|||
<if test="site != null"> |
|||
and site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="id != null"> |
|||
and id=#{id,jdbcType=INTEGER} |
|||
</if> |
|||
<if test="departmentNo != null and departmentNo != ''"> |
|||
and department_no = #{departmentNo,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</update> |
|||
<delete id="deleteDepartment"> |
|||
<!--@mbg.generated--> |
|||
delete from department |
|||
<where> |
|||
<if test="site != null"> |
|||
and site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="id != null"> |
|||
and id=#{id,jdbcType=INTEGER} |
|||
</if> |
|||
</where> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,164 @@ |
|||
<?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.gaotao.modules.toolman.dao.WareHouseMapper"> |
|||
<resultMap id="BaseResultMap" type="com.gaotao.modules.toolman.entity.WareHouseData"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table WareHouse--> |
|||
<id column="Site" jdbcType="VARCHAR" property="site" /> |
|||
<id column="WareHouseID" jdbcType="VARCHAR" property="wareHouseId" /> |
|||
<result column="WareHouseName" jdbcType="VARCHAR" property="wareHouseName" /> |
|||
<result column="Active" jdbcType="CHAR" property="active" /> |
|||
<result column="WareHouseType" jdbcType="VARCHAR" property="wareHouseType" /> |
|||
<result column="WareHouseType_DB" jdbcType="CHAR" property="wareHouseTypeDb" /> |
|||
<result column="Keeper" jdbcType="VARCHAR" property="keeper" /> |
|||
<result column="CompanyID" jdbcType="VARCHAR" property="companyId" /> |
|||
<result column="ValidStock" jdbcType="CHAR" property="validStock" /> |
|||
<result column="UseLocation" jdbcType="CHAR" property="useLocation" /> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
Site, WareHouseID, WareHouseName, Active, WareHouseType, WareHouseType_DB, Keeper, |
|||
CompanyID, ValidStock, UseLocation |
|||
</sql> |
|||
<select id="getWareHouseList" resultMap="BaseResultMap"> |
|||
<!--@mbg.generated--> |
|||
select A.Site,A.WareHouseID,A.WareHouseName,A.Active,A.WareHouseType,A.WareHouseType_DB,A.Keeper,A.CompanyID |
|||
,A.ValidStock,A.UseLocation |
|||
,(case A.Active when 'Y' then '启用' else '禁用' end) as strActive |
|||
from WareHouse A |
|||
<where> |
|||
<if test="site != null and site != ''"> |
|||
and A.Site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="wareHouseId != null and wareHouseId != ''"> |
|||
and A.WareHouseID like '%' + #{wareHouseId,jdbcType=VARCHAR} + '%' |
|||
</if> |
|||
<if test="wareHouseName != null and wareHouseName != ''"> |
|||
and A.WareHouseName like '%' + #{wareHouseName,jdbcType=VARCHAR} + '%' |
|||
</if> |
|||
<if test="active != null and active != ''"> |
|||
and A.Active=#{active,jdbcType=CHAR} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<insert id="insertSelective"> |
|||
<!--@mbg.generated--> |
|||
INSERT INTO WareHouse |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="site!=null">Site,</if> |
|||
<if test="wareHouseId != null">WareHouseID,</if> |
|||
<if test="wareHouseName != null">WareHouseName,</if> |
|||
<if test="active!=null">Active,</if> |
|||
<if test="wareHouseType != null">WareHouseType,</if> |
|||
<if test="wareHouseTypeDb != null">WareHouseType_DB,</if> |
|||
<if test="keeper!=null">Keeper,</if> |
|||
<if test="companyId != null">CompanyID,</if> |
|||
<if test="validStock != null">ValidStock,</if> |
|||
<if test="useLocation != null">UseLocation</if> |
|||
</trim> |
|||
VALUES |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="site!=null">#{site,jdbcType=VARCHAR},</if> |
|||
<if test="wareHouseId!=null">#{wareHouseId,jdbcType=VARCHAR},</if> |
|||
<if test="wareHouseName!=null">#{wareHouseName,jdbcType=VARCHAR},</if> |
|||
<if test="active!=null">#{active,jdbcType=CHAR},</if> |
|||
<if test="wareHouseType!=null">#{wareHouseType,jdbcType=VARCHAR},</if> |
|||
<if test="wareHouseTypeDb!=null">#{wareHouseTypeDb,jdbcType=VARCHAR},</if> |
|||
<if test="keeper!=null">#{keeper,jdbcType=VARCHAR},</if> |
|||
<if test="companyId!=null">#{companyId,jdbcType=VARCHAR},</if> |
|||
<if test="validStock!=null">#{validStock,jdbcType=VARCHAR},</if> |
|||
<if test="useLocation!=null">#{useLocation,jdbcType=VARCHAR}</if> |
|||
</trim> |
|||
</insert> |
|||
<insert id="insertList"> |
|||
<!--@mbg.generated--> |
|||
INSERT INTO WareHouse( |
|||
Site, |
|||
WareHouseID, |
|||
WareHouseName, |
|||
Active, |
|||
WareHouseType, |
|||
WareHouseType_DB, |
|||
Keeper, |
|||
CompanyID, |
|||
ValidStock, |
|||
UseLocation |
|||
)VALUES |
|||
<foreach collection="list" item="element" index="index" separator=","> |
|||
( |
|||
#{element.site,jdbcType=VARCHAR}, |
|||
#{element.wareHouseId,jdbcType=VARCHAR}, |
|||
#{element.wareHouseName,jdbcType=VARCHAR}, |
|||
#{element.active,jdbcType=CHAR}, |
|||
#{element.wareHouseType,jdbcType=VARCHAR}, |
|||
#{element.wareHouseTypeDb,jdbcType=VARCHAR}, |
|||
#{element.keeper,jdbcType=VARCHAR}, |
|||
#{element.companyId,jdbcType=VARCHAR}, |
|||
#{element.validStock,jdbcType=VARCHAR}, |
|||
#{element.useLocation,jdbcType=VARCHAR} |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
<update id="updateWarehouse"> |
|||
<!--@mbg.generated--> |
|||
update WareHouse |
|||
<set> |
|||
<if test="wareHouseName != null and wareHouseName != ''"> |
|||
WareHouseName = #{wareHouseName,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="active != null and active != ''"> |
|||
Active = #{active,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="wareHouseType != null and wareHouseType != ''"> |
|||
WareHouseType = #{wareHouseType,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="wareHouseTypeDb != null and wareHouseTypeDb != ''"> |
|||
WareHouseType_DB = #{wareHouseTypeDb,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="keeper != null and keeper != ''"> |
|||
Keeper = #{keeper,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="companyId != null and companyId != ''"> |
|||
CompanyID = #{companyId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="validStock != null and validStock != ''"> |
|||
ValidStock = #{validStock,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="useLocation != null and useLocation != ''"> |
|||
UseLocation = #{useLocation,jdbcType=VARCHAR}, |
|||
</if> |
|||
</set> |
|||
<where> |
|||
<if test="site != null"> |
|||
and Site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="wareHouseId != null and wareHouseId != ''"> |
|||
and WareHouseID=#{wareHouseId,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</update> |
|||
<delete id="deleteWarehouse"> |
|||
<!--@mbg.generated--> |
|||
delete from WareHouse |
|||
<where> |
|||
<if test="site != null"> |
|||
and Site=#{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="wareHouseId != null"> |
|||
and WareHouseID=#{wareHouseId,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</delete> |
|||
|
|||
<select id="getWarehouseCount" resultType="java.lang.Integer"> |
|||
select count(1) from warehouse |
|||
<where> |
|||
<if test="site != null and site != ''"> |
|||
and site = #{site,jdbcType=VARCHAR} |
|||
</if> |
|||
<if test="wareHouseId != null and wareHouseId != ''"> |
|||
and WareHouseID = #{wareHouseId,jdbcType=VARCHAR} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue