Commit 0998f554 by huangZW

111

parent f714a8dd
......@@ -12,4 +12,7 @@ public interface AuditApiService {
Page<AuditDTO> page(Integer auditType, String search,String enterpriseId,Integer auditStatus,BasePageInfo pageInfo);
void audit(String auditId);
void refuse(String auditId,String auditReason);
}
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import com.github.pagehelper.Page;
public interface AuditMapper {
int deleteByPrimaryKey(Integer auditId);
public interface TabHaobanAuditMapper {
int deleteByPrimaryKey(String auditId);
int insert(TabHaobanAudit record);
int insertSelective(TabHaobanAudit record);
TabHaobanAudit selectByPrimaryKey(Integer auditId);
TabHaobanAudit selectByPrimaryKey(String auditId);
int updateByPrimaryKeySelective(TabHaobanAudit record);
int updateByPrimaryKey(TabHaobanAudit record);
Page<TabHaobanAudit> page(Integer auditType, List<String> storeIds,List<String>staffIds, String enterpriseId,Integer auditStatus );
}
\ No newline at end of file
......@@ -4,13 +4,13 @@ import java.io.Serializable;
import java.util.Date;
public class TabHaobanAudit implements Serializable {
private Integer auditId;
private String auditId;
private Integer auditType;
private String commitName;
private Integer commitStaffId;
private String commitStaffId;
private String commitStaffName;
......@@ -34,14 +34,20 @@ public class TabHaobanAudit implements Serializable {
private String auditReason;
private Date createTime;
private Date updateTime;
private Integer statusFlag;
private static final long serialVersionUID = 1L;
public Integer getAuditId() {
public String getAuditId() {
return auditId;
}
public void setAuditId(Integer auditId) {
this.auditId = auditId;
public void setAuditId(String auditId) {
this.auditId = auditId == null ? null : auditId.trim();
}
public Integer getAuditType() {
......@@ -60,12 +66,12 @@ public class TabHaobanAudit implements Serializable {
this.commitName = commitName == null ? null : commitName.trim();
}
public Integer getCommitStaffId() {
public String getCommitStaffId() {
return commitStaffId;
}
public void setCommitStaffId(Integer commitStaffId) {
this.commitStaffId = commitStaffId;
public void setCommitStaffId(String commitStaffId) {
this.commitStaffId = commitStaffId == null ? null : commitStaffId.trim();
}
public String getCommitStaffName() {
......@@ -155,4 +161,28 @@ public class TabHaobanAudit implements Serializable {
public void setAuditReason(String auditReason) {
this.auditReason = auditReason == null ? null : auditReason.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
}
\ No newline at end of file
......@@ -30,4 +30,17 @@ public class AuditApiServiceImpl implements AuditApiService{
com.github.pagehelper.Page<TabHaobanAudit> page = auditMapper.page(auditType, storeIds, staffIds, enterpriseId,auditStatus);
return PageUtil.changePageHelperToCurrentPage( page,AuditDTO.class);
}
@Override
public void audit(String auditId) {
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(auditId);
tab.setAuditStatus(1);
tab.set
auditMapper.updateByPrimaryKeySelective(tab);
}
@Override
public void refuse(String auditId, String auditReason) {
// TODO Auto-generated method stub
}
}
<?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.gic.haoban.manage.service.dao.mapper.AuditMapper" >
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper" >
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
<id column="audit_id" property="auditId" jdbcType="INTEGER" />
<id column="audit_id" property="auditId" jdbcType="VARCHAR" />
<result column="audit_type" property="auditType" jdbcType="INTEGER" />
<result column="commit_name" property="commitName" jdbcType="VARCHAR" />
<result column="commit_staff_id" property="commitStaffId" jdbcType="INTEGER" />
<result column="commit_staff_id" property="commitStaffId" jdbcType="VARCHAR" />
<result column="commit_staff_name" property="commitStaffName" jdbcType="VARCHAR" />
<result column="commit_staff_img" property="commitStaffImg" jdbcType="VARCHAR" />
<result column="commit_store_id" property="commitStoreId" jdbcType="VARCHAR" />
......@@ -17,34 +17,39 @@
<result column="audit_name" property="auditName" jdbcType="VARCHAR" />
<result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
<result column="audit_reason" property="auditReason" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason
audit_name, audit_status, audit_reason, create_time, update_time, status_flag
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where audit_id = #{auditId,jdbcType=INTEGER}
where audit_id = #{auditId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tab_haoban_audit
where audit_id = #{auditId,jdbcType=INTEGER}
where audit_id = #{auditId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
insert into tab_haoban_audit (audit_id, audit_type, commit_name,
commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value,
new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason
audit_name, audit_status, audit_reason,
create_time, update_time, status_flag
)
values (#{auditId,jdbcType=INTEGER}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=INTEGER}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
values (#{auditId,jdbcType=VARCHAR}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=VARCHAR}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
#{commitStoreId,jdbcType=VARCHAR}, #{changeField,jdbcType=VARCHAR}, #{oldValue,jdbcType=VARCHAR},
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR}
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
......@@ -95,10 +100,19 @@
<if test="auditReason != null" >
audit_reason,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="statusFlag != null" >
status_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="auditId != null" >
#{auditId,jdbcType=INTEGER},
#{auditId,jdbcType=VARCHAR},
</if>
<if test="auditType != null" >
#{auditType,jdbcType=INTEGER},
......@@ -107,7 +121,7 @@
#{commitName,jdbcType=VARCHAR},
</if>
<if test="commitStaffId != null" >
#{commitStaffId,jdbcType=INTEGER},
#{commitStaffId,jdbcType=VARCHAR},
</if>
<if test="commitStaffName != null" >
#{commitStaffName,jdbcType=VARCHAR},
......@@ -142,6 +156,15 @@
<if test="auditReason != null" >
#{auditReason,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
......@@ -154,7 +177,7 @@
commit_name = #{commitName,jdbcType=VARCHAR},
</if>
<if test="commitStaffId != null" >
commit_staff_id = #{commitStaffId,jdbcType=INTEGER},
commit_staff_id = #{commitStaffId,jdbcType=VARCHAR},
</if>
<if test="commitStaffName != null" >
commit_staff_name = #{commitStaffName,jdbcType=VARCHAR},
......@@ -189,14 +212,23 @@
<if test="auditReason != null" >
audit_reason = #{auditReason,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
</set>
where audit_id = #{auditId,jdbcType=INTEGER}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
update tab_haoban_audit
set audit_type = #{auditType,jdbcType=INTEGER},
commit_name = #{commitName,jdbcType=VARCHAR},
commit_staff_id = #{commitStaffId,jdbcType=INTEGER},
commit_staff_id = #{commitStaffId,jdbcType=VARCHAR},
commit_staff_name = #{commitStaffName,jdbcType=VARCHAR},
commit_staff_img = #{commitStaffImg,jdbcType=VARCHAR},
commit_store_id = #{commitStoreId,jdbcType=VARCHAR},
......@@ -207,38 +239,10 @@
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
audit_name = #{auditName,jdbcType=VARCHAR},
audit_status = #{auditStatus,jdbcType=INTEGER},
audit_reason = #{auditReason,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=INTEGER}
audit_reason = #{auditReason,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status_flag = #{statusFlag,jdbcType=INTEGER}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
<sql id="storeSql">
<if test="null != storeIds and storeIds.size gt 0">
and commit_store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<sql id="staffSql">
<if test="null != staffIds and staffIds.size gt 0">
and commit_staff_id in
<foreach collection="staffIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<select id="page" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
<if test = "audit_type != null">
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if test = "audit_status != null">
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
<include refid="storeSql"/>
<include refid="staffSql"/>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment