Ver Fonte

Merge remote-tracking branch 'origin/master'

pangjl há 4 anos atrás
pai
commit
b4442ebc8c

+ 97 - 0
src/main/java/com/minpay/db/table/mapper/ImItemFunctionBranchMapper.java

@@ -0,0 +1,97 @@
+package com.minpay.db.table.mapper;
+
+import com.minpay.db.table.model.ImItemFunctionBranch;
+import com.minpay.db.table.model.ImItemFunctionBranchExample;
+import com.startup.minpay.frame.jdbc.IMINMybatisEntityMapper;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ImItemFunctionBranchMapper extends IMINMybatisEntityMapper<ImItemFunctionBranch, String, ImItemFunctionBranchExample> {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int countByExample(ImItemFunctionBranchExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int deleteByExample(ImItemFunctionBranchExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int insert(ImItemFunctionBranch record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int insertSelective(ImItemFunctionBranch record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    List<ImItemFunctionBranch> selectByExample(ImItemFunctionBranchExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    ImItemFunctionBranch selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int updateByExampleSelective(@Param("record") ImItemFunctionBranch record, @Param("example") ImItemFunctionBranchExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int updateByExample(@Param("record") ImItemFunctionBranch record, @Param("example") ImItemFunctionBranchExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int updateByPrimaryKeySelective(ImItemFunctionBranch record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    int updateByPrimaryKey(ImItemFunctionBranch record);
+}

+ 165 - 0
src/main/java/com/minpay/db/table/model/ImItemFunctionBranch.java

@@ -0,0 +1,165 @@
+package com.minpay.db.table.model;
+
+import com.startup.minpay.frame.data.AbstractMINBean;
+
+public class ImItemFunctionBranch extends AbstractMINBean {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_item_function_branch.IFB_ID
+     *
+     * @mbggenerated
+     */
+    private String id;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_item_function_branch.IFB_BRANCH
+     *
+     * @mbggenerated
+     */
+    private String branch;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_item_function_branch.IFB_FUNCTION_ID
+     *
+     * @mbggenerated
+     */
+    private String functionId;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_item_function_branch.IFB_CREATE_TIME
+     *
+     * @mbggenerated
+     */
+    private String createTime;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_item_function_branch.IFB_CREATE_USER
+     *
+     * @mbggenerated
+     */
+    private String createUser;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_item_function_branch.IFB_ID
+     *
+     * @return the value of im_item_function_branch.IFB_ID
+     *
+     * @mbggenerated
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_item_function_branch.IFB_ID
+     *
+     * @param id the value for im_item_function_branch.IFB_ID
+     *
+     * @mbggenerated
+     */
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_item_function_branch.IFB_BRANCH
+     *
+     * @return the value of im_item_function_branch.IFB_BRANCH
+     *
+     * @mbggenerated
+     */
+    public String getBranch() {
+        return branch;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_item_function_branch.IFB_BRANCH
+     *
+     * @param branch the value for im_item_function_branch.IFB_BRANCH
+     *
+     * @mbggenerated
+     */
+    public void setBranch(String branch) {
+        this.branch = branch == null ? null : branch.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_item_function_branch.IFB_FUNCTION_ID
+     *
+     * @return the value of im_item_function_branch.IFB_FUNCTION_ID
+     *
+     * @mbggenerated
+     */
+    public String getFunctionId() {
+        return functionId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_item_function_branch.IFB_FUNCTION_ID
+     *
+     * @param functionId the value for im_item_function_branch.IFB_FUNCTION_ID
+     *
+     * @mbggenerated
+     */
+    public void setFunctionId(String functionId) {
+        this.functionId = functionId == null ? null : functionId.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_item_function_branch.IFB_CREATE_TIME
+     *
+     * @return the value of im_item_function_branch.IFB_CREATE_TIME
+     *
+     * @mbggenerated
+     */
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_item_function_branch.IFB_CREATE_TIME
+     *
+     * @param createTime the value for im_item_function_branch.IFB_CREATE_TIME
+     *
+     * @mbggenerated
+     */
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime == null ? null : createTime.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_item_function_branch.IFB_CREATE_USER
+     *
+     * @return the value of im_item_function_branch.IFB_CREATE_USER
+     *
+     * @mbggenerated
+     */
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_item_function_branch.IFB_CREATE_USER
+     *
+     * @param createUser the value for im_item_function_branch.IFB_CREATE_USER
+     *
+     * @mbggenerated
+     */
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser == null ? null : createUser.trim();
+    }
+}

+ 671 - 0
src/main/java/com/minpay/db/table/model/ImItemFunctionBranchExample.java

@@ -0,0 +1,671 @@
+package com.minpay.db.table.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ImItemFunctionBranchExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public ImItemFunctionBranchExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("IFB_ID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("IFB_ID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(String value) {
+            if(value == null ){
+                andIdIsNull();
+            } else {
+                addCriterion("IFB_ID =", value, "id");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(String value) {
+            if(value == null ){
+                andIdIsNotNull();
+            } else {
+                addCriterion("IFB_ID <>", value, "id");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(String value) {
+            addCriterion("IFB_ID >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(String value) {
+            addCriterion("IFB_ID >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(String value) {
+            addCriterion("IFB_ID <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(String value) {
+            addCriterion("IFB_ID <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLike(String value) {
+            addCriterion("IFB_ID like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotLike(String value) {
+            addCriterion("IFB_ID not like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<String> values) {
+            addCriterion("IFB_ID in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<String> values) {
+            addCriterion("IFB_ID not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(String value1, String value2) {
+            addCriterion("IFB_ID between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(String value1, String value2) {
+            addCriterion("IFB_ID not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIsNull() {
+            addCriterion("IFB_BRANCH is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIsNotNull() {
+            addCriterion("IFB_BRANCH is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNull();
+            } else {
+                addCriterion("IFB_BRANCH =", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNotNull();
+            } else {
+                addCriterion("IFB_BRANCH <>", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThan(String value) {
+            addCriterion("IFB_BRANCH >", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThanOrEqualTo(String value) {
+            addCriterion("IFB_BRANCH >=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThan(String value) {
+            addCriterion("IFB_BRANCH <", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThanOrEqualTo(String value) {
+            addCriterion("IFB_BRANCH <=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLike(String value) {
+            addCriterion("IFB_BRANCH like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotLike(String value) {
+            addCriterion("IFB_BRANCH not like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIn(List<String> values) {
+            addCriterion("IFB_BRANCH in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotIn(List<String> values) {
+            addCriterion("IFB_BRANCH not in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchBetween(String value1, String value2) {
+            addCriterion("IFB_BRANCH between", value1, value2, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotBetween(String value1, String value2) {
+            addCriterion("IFB_BRANCH not between", value1, value2, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdIsNull() {
+            addCriterion("IFB_FUNCTION_ID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdIsNotNull() {
+            addCriterion("IFB_FUNCTION_ID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdEqualTo(String value) {
+            if(value == null ){
+                andFunctionIdIsNull();
+            } else {
+                addCriterion("IFB_FUNCTION_ID =", value, "functionId");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdNotEqualTo(String value) {
+            if(value == null ){
+                andFunctionIdIsNotNull();
+            } else {
+                addCriterion("IFB_FUNCTION_ID <>", value, "functionId");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdGreaterThan(String value) {
+            addCriterion("IFB_FUNCTION_ID >", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdGreaterThanOrEqualTo(String value) {
+            addCriterion("IFB_FUNCTION_ID >=", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdLessThan(String value) {
+            addCriterion("IFB_FUNCTION_ID <", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdLessThanOrEqualTo(String value) {
+            addCriterion("IFB_FUNCTION_ID <=", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdLike(String value) {
+            addCriterion("IFB_FUNCTION_ID like", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdNotLike(String value) {
+            addCriterion("IFB_FUNCTION_ID not like", value, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdIn(List<String> values) {
+            addCriterion("IFB_FUNCTION_ID in", values, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdNotIn(List<String> values) {
+            addCriterion("IFB_FUNCTION_ID not in", values, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdBetween(String value1, String value2) {
+            addCriterion("IFB_FUNCTION_ID between", value1, value2, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFunctionIdNotBetween(String value1, String value2) {
+            addCriterion("IFB_FUNCTION_ID not between", value1, value2, "functionId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("IFB_CREATE_TIME is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("IFB_CREATE_TIME is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(String value) {
+            if(value == null ){
+                andCreateTimeIsNull();
+            } else {
+                addCriterion("IFB_CREATE_TIME =", value, "createTime");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(String value) {
+            if(value == null ){
+                andCreateTimeIsNotNull();
+            } else {
+                addCriterion("IFB_CREATE_TIME <>", value, "createTime");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(String value) {
+            addCriterion("IFB_CREATE_TIME >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(String value) {
+            addCriterion("IFB_CREATE_TIME >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(String value) {
+            addCriterion("IFB_CREATE_TIME <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(String value) {
+            addCriterion("IFB_CREATE_TIME <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLike(String value) {
+            addCriterion("IFB_CREATE_TIME like", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotLike(String value) {
+            addCriterion("IFB_CREATE_TIME not like", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<String> values) {
+            addCriterion("IFB_CREATE_TIME in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<String> values) {
+            addCriterion("IFB_CREATE_TIME not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(String value1, String value2) {
+            addCriterion("IFB_CREATE_TIME between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(String value1, String value2) {
+            addCriterion("IFB_CREATE_TIME not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserIsNull() {
+            addCriterion("IFB_CREATE_USER is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserIsNotNull() {
+            addCriterion("IFB_CREATE_USER is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserEqualTo(String value) {
+            if(value == null ){
+                andCreateUserIsNull();
+            } else {
+                addCriterion("IFB_CREATE_USER =", value, "createUser");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserNotEqualTo(String value) {
+            if(value == null ){
+                andCreateUserIsNotNull();
+            } else {
+                addCriterion("IFB_CREATE_USER <>", value, "createUser");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserGreaterThan(String value) {
+            addCriterion("IFB_CREATE_USER >", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
+            addCriterion("IFB_CREATE_USER >=", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserLessThan(String value) {
+            addCriterion("IFB_CREATE_USER <", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserLessThanOrEqualTo(String value) {
+            addCriterion("IFB_CREATE_USER <=", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserLike(String value) {
+            addCriterion("IFB_CREATE_USER like", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserNotLike(String value) {
+            addCriterion("IFB_CREATE_USER not like", value, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserIn(List<String> values) {
+            addCriterion("IFB_CREATE_USER in", values, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserNotIn(List<String> values) {
+            addCriterion("IFB_CREATE_USER not in", values, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserBetween(String value1, String value2) {
+            addCriterion("IFB_CREATE_USER between", value1, value2, "createUser");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUserNotBetween(String value1, String value2) {
+            addCriterion("IFB_CREATE_USER not between", value1, value2, "createUser");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated do_not_delete_during_merge
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table im_item_function_branch
+     *
+     * @mbggenerated
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.betweenValue = true;
+        }
+    }
+}

+ 23 - 21
src/main/java/com/minpay/db/table/own/mapper/BranchManageMapper.java

@@ -10,27 +10,29 @@ import com.startup.minpay.frame.jdbc.MINRowBounds;
 
 
 public interface BranchManageMapper extends IMINMybatisEntityMapper {
-	 List<Map<String, Object>> queryAllBranch(Map<String, String> map, MINRowBounds rows);
-	 List<Map<String,String>> queryAllBranch(Map<String, String> map);
-	 List<Map<String,String>>  queryBranchNo(Map<String, String> map);
-	 List<Map<String,String>> queryBranchNoByPointNo(Map<String, String> map);
-	 List<Map<String,String>> getUnInstallSchool(Map<String, String> map);
-	 List<Map<String,String>> getChildBranch(Map<String, String> map);
-	 /**
-	  * 查询子机构
-	  * @param map
-	  * @return
-	  */
-	 List<Map<String,String>> getChildBranchById(Map<String, String> map);
-	 
-	 List<Map<String, Object>> queryBranchByLevel(Map<String, String> map, MINRowBounds rows);
-	 int updateBranchUrl(Map<String, String> map);
-	 int updateBranchUrlState(Map<String, String> map);
-	 /**
-	  * 查询代理的所有校园
-	  * @param map
-	  * @return
-	  */
+	List<Map<String, Object>> queryAllBranch(Map<String, String> map, MINRowBounds rows);
+	List<Map<String,String>> queryAllBranch(Map<String, String> map);
+	List<Map<String,String>>  queryBranchNo(Map<String, String> map);
+	List<Map<String,String>> queryBranchNoByPointNo(Map<String, String> map);
+	List<Map<String,String>> getUnInstallSchool(Map<String, String> map);
+	List<Map<String,String>> getChildBranch(Map<String, String> map);
+	/**
+	 * 查询子机构
+	 * @param map
+	 * @return
+	 */
+	List<Map<String,String>> getChildBranchById(Map<String, String> map);
+
+	List<Map<String, Object>> queryBranchByLevel(Map<String, String> map, MINRowBounds rows);
+	int updateBranchUrl(Map<String, String> map);
+	int updateBranchUrlState(Map<String, String> map);
+	/**
+	 * 查询代理的所有校园
+	 * @param map
+	 * @return
+	 */
 	List<Map<String, Object>> queryAllSchool(Map<String, Object> map, MINRowBounds rows);
 	List<Map<String, Object>> queryAllSchool(Map<String, Object> map);
+	//查询权限
+	List<Map<String, String>> queryPower(Map<String, String> map);
 }

+ 100 - 33
src/main/java/com/minpay/huicai/personmanage/action/DepartmentManageAction.java

@@ -1,22 +1,16 @@
 package com.minpay.huicai.personmanage.action;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import com.min.util.DateUtil;
 import com.minpay.common.bean.User;
-import com.minpay.common.constant.Constant;
 import com.minpay.common.exception.BusinessCodeException;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.IPublicService;
 import com.minpay.common.util.RegexUtil;
 import com.minpay.db.table.mapper.ImBranchMapper;
+import com.minpay.db.table.mapper.ImItemFunctionBranchMapper;
 import com.minpay.db.table.mapper.ImUserMapper;
-import com.minpay.db.table.model.ImBranch;
-import com.minpay.db.table.model.ImBranchExample;
-import com.minpay.db.table.model.ImUser;
-import com.minpay.db.table.model.ImUserExample;
+import com.minpay.db.table.model.*;
 import com.minpay.db.table.own.mapper.BranchManageMapper;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.MINHttpServletRequestContext;
@@ -33,6 +27,9 @@ import com.startup.minpay.frame.target.MINAction;
 import com.startup.minpay.frame.target.MINComponent;
 import com.startup.minpay.frame.target.MINParam;
 import com.startup.minpay.frame.target.MINValidator;
+import com.startup.minpay.util.Str;
+
+import java.util.*;
 
 /**
  * 部门管理
@@ -41,22 +38,92 @@ import com.startup.minpay.frame.target.MINValidator;
  */
 @MINComponent
 public class DepartmentManageAction implements IMINAction {
-	
+
 	/**查询部门*/
 	public final static String	BRANCH_QUERY_ALL		= "branchQueryAll";
-	
+
 	/**添加部门*/
 	public final static String	ADD_BRANCH  			= "addBranch";
-	
+
 	/**删除部门*/
 	public final static String	DELETE_BRANCH		    = "deleteBranch";
-	
+
 	/**编辑部门*/
 	public final static String	MODIFY_BRANCH	  		= "modifyBranch";
-	
+
 	/**部门人员列表*/
 	public final static String STAFFLIST                = "staffList";
-	
+
+	/**查询权限*/
+	public final static String QUERY_POWER                = "queryPower";
+
+	/**修改权限*/
+	public final static String POWER_MODIFY                = "powerModify";
+
+
+	/**
+	 * 修改机构权限
+	 * @param branchId
+	 * @param itemidStrs
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = POWER_MODIFY)
+	public MINActionResult powerModify(
+			@MINParam(key = "branchId") String branchId,
+			@MINParam(key = "itemidStrs") String itemidStrs,
+			MINSession session)
+			throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		//删除已保存菜单
+		ImItemFunctionBranchExample IIFBExample = new ImItemFunctionBranchExample();
+		IIFBExample.createCriteria().andBranchEqualTo(branchId);
+		Service.lookup(IMINDataBaseService.class).deleteByExample(ImItemFunctionBranchMapper.class, IIFBExample);
+
+		//截取已选菜单
+		String[] itemidArr = itemidStrs.split(",");
+		for (int i = 0; i < itemidArr.length; i++) {
+			ImItemFunctionBranch IIFB = new ImItemFunctionBranch();
+			String itemId = itemidArr[i];
+			//序列
+			String No = Service.lookup(IPublicService.class).getSequence("VM_IMITEM_FUNBRANCH");
+			String dateTime = DateUtil.getCurrentDateTimeString();
+			IIFB.setId(No);
+			IIFB.setBranch(branchId);
+			IIFB.setFunctionId(itemId);
+			IIFB.setCreateTime(dateTime);
+			Service.lookup(IMINDataBaseService.class).insertSelective(ImItemFunctionBranchMapper.class, IIFB);
+		}
+		String logInfo = "修改机构权限,机构"+branchId + ",权限"+itemidStrs;
+		Service.lookup(ILogService.class).logging(session, logInfo);
+		return res;
+	}
+
+	/**
+	 * 查询机构权限
+	 * @param branchId
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = QUERY_POWER)
+	public MINActionResult queryPower(
+			@MINParam(key = "branchId") String branchId,
+			MINSession session)
+			throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		Map<String, String> map = new HashMap<String, String>();
+		map.put("branchId", branchId);
+		List<Map<String, String>> ls = null;
+		// 查看角色使用
+		ls = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(BranchManageMapper.class)
+				.queryPower(map);
+		res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
+		return res;
+	}
+
 	/**
 	 * 查询当前操作员所属机构以及下属机构信息
 	 * @param page
@@ -78,8 +145,8 @@ public class DepartmentManageAction implements IMINAction {
 			@MINParam(key = "phone") String phone,
 			@MINParam(key = "bIds") String bIds,
 			MINSession session
-			) throws MINBusinessException {
-		
+	) throws MINBusinessException {
+
 		MINActionResult res = new MINActionResult();
 		MINRowBounds rows = new MINRowBounds(page, limit);
 		User user = session.getUser();
@@ -115,11 +182,11 @@ public class DepartmentManageAction implements IMINAction {
 		ls = Service.lookup(IFormatService.class).formatEnum(ls, "{sttdesc:'IM_BRANCH_STATE',leveldesc:'IM_BRANCH_LEVEL',branchTypedesc:'BRANCH_TYPE'}");
 		res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
 		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
-		
+
 		return res;
 	}
-	
-	
+
+
 	/**
 	 * 添加部门(添加商户)
 	 * @param fapResult
@@ -139,13 +206,13 @@ public class DepartmentManageAction implements IMINAction {
 			@MINParam(key ="person") String person,
 			@MINParam(key ="phone") String phone,
 			MINSession session
-			) throws MINBusinessException {
+	) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		User user = session.getUser();
 		String branchId = user.getBranchid();
 		ImBranch imb =	Service.lookup(IMINDataBaseService.class)
-						.getMybatisMapper(ImBranchMapper.class)
-						.selectByPrimaryKey(branchId);
+				.getMybatisMapper(ImBranchMapper.class)
+				.selectByPrimaryKey(branchId);
 		if(imb==null){
 			throw  new MINBusinessException("获取机构信息异常!");
 		}
@@ -212,7 +279,7 @@ public class DepartmentManageAction implements IMINAction {
 			@MINParam(key ="phone") String phone,
 			@MINParam(key ="desc") String desc,
 			MINSession session
-			) throws MINBusinessException {
+	) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		//检查部门名称
 		ImBranchExample ibe = new ImBranchExample();
@@ -233,7 +300,7 @@ public class DepartmentManageAction implements IMINAction {
 		}
 		// 记录日志
 		String logInfo = "修改商户 :"+branchName+",商户编号:"+branchId;
-		Service.lookup(ILogService.class).logging(session, logInfo);	
+		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 	}
 
@@ -248,8 +315,8 @@ public class DepartmentManageAction implements IMINAction {
 		MINActionResult res = new MINActionResult();
 		return res;
 	}
-	
-	
+
+
 	/**
 	 * 删除部门
 	 * @param branchId
@@ -262,7 +329,7 @@ public class DepartmentManageAction implements IMINAction {
 			@MINParam(key ="branchId") String branchId,
 			@MINParam(key ="state") String state,
 			MINSession session
-			) throws MINBusinessException {
+	) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		if(!"0".equals(state) && !"1".equals(state) && !"2".equals(state)){
 			throw  new MINBusinessException("数据异常");
@@ -279,11 +346,11 @@ public class DepartmentManageAction implements IMINAction {
 			ib.setId(branchId);
 			ib.setStt(state);
 			int ret = Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(ImBranchMapper.class, ib);
-			 if(0 == ret){
+			if(0 == ret){
 				throw  new MINBusinessException("更新数据时出现异常");
-			 }
+			}
 			String logInfo = "删除部门 ,部门编号:"+branchId;
-			Service.lookup(ILogService.class).logging(session, logInfo);	
+			Service.lookup(ILogService.class).logging(session, logInfo);
 		}
 		return res;
 	}
@@ -307,7 +374,7 @@ public class DepartmentManageAction implements IMINAction {
 	public MINActionResult staffList(
 			@MINParam(key ="branchId") String branchId,
 			MINSession session
-			) throws MINBusinessException {
+	) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		//查看该部门人员
 		ImUserExample example = new ImUserExample();
@@ -316,5 +383,5 @@ public class DepartmentManageAction implements IMINAction {
 		res.set(IMINBusinessConstant.F_PAGING_LAY, userList);
 		return res;
 	}
-	
+
 }

+ 271 - 0
src/main/resources/com/minpay/db/table/mapper/ImItemFunctionBranchMapper.xml

@@ -0,0 +1,271 @@
+<?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.minpay.db.table.mapper.ImItemFunctionBranchMapper" >
+  <resultMap id="BaseResultMap" type="com.minpay.db.table.model.ImItemFunctionBranch" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <id column="IFB_ID" property="id" jdbcType="VARCHAR" />
+    <result column="IFB_BRANCH" property="branch" jdbcType="VARCHAR" />
+    <result column="IFB_FUNCTION_ID" property="functionId" jdbcType="VARCHAR" />
+    <result column="IFB_CREATE_TIME" property="createTime" jdbcType="VARCHAR" />
+    <result column="IFB_CREATE_USER" property="createUser" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Example_Where_Clause" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where >
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where >
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    IFB_ID, IFB_BRANCH, IFB_FUNCTION_ID, IFB_CREATE_TIME, IFB_CREATE_USER
+  </sql>
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.minpay.db.table.model.ImItemFunctionBranchExample" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select
+    <if test="distinct" >
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from im_item_function_branch
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null" >
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from im_item_function_branch
+    where IFB_ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from im_item_function_branch
+    where IFB_ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.minpay.db.table.model.ImItemFunctionBranchExample" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from im_item_function_branch
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.minpay.db.table.model.ImItemFunctionBranch" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into im_item_function_branch (IFB_ID, IFB_BRANCH, IFB_FUNCTION_ID, 
+      IFB_CREATE_TIME, IFB_CREATE_USER)
+    values (#{id,jdbcType=VARCHAR}, #{branch,jdbcType=VARCHAR}, #{functionId,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.minpay.db.table.model.ImItemFunctionBranch" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into im_item_function_branch
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        IFB_ID,
+      </if>
+      <if test="branch != null" >
+        IFB_BRANCH,
+      </if>
+      <if test="functionId != null" >
+        IFB_FUNCTION_ID,
+      </if>
+      <if test="createTime != null" >
+        IFB_CREATE_TIME,
+      </if>
+      <if test="createUser != null" >
+        IFB_CREATE_USER,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="branch != null" >
+        #{branch,jdbcType=VARCHAR},
+      </if>
+      <if test="functionId != null" >
+        #{functionId,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=VARCHAR},
+      </if>
+      <if test="createUser != null" >
+        #{createUser,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.minpay.db.table.model.ImItemFunctionBranchExample" resultType="java.lang.Integer" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select count(*) from im_item_function_branch
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update im_item_function_branch
+    <set >
+      <if test="record.id != null" >
+        IFB_ID = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.branch != null" >
+        IFB_BRANCH = #{record.branch,jdbcType=VARCHAR},
+      </if>
+      <if test="record.functionId != null" >
+        IFB_FUNCTION_ID = #{record.functionId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null" >
+        IFB_CREATE_TIME = #{record.createTime,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createUser != null" >
+        IFB_CREATE_USER = #{record.createUser,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update im_item_function_branch
+    set IFB_ID = #{record.id,jdbcType=VARCHAR},
+      IFB_BRANCH = #{record.branch,jdbcType=VARCHAR},
+      IFB_FUNCTION_ID = #{record.functionId,jdbcType=VARCHAR},
+      IFB_CREATE_TIME = #{record.createTime,jdbcType=VARCHAR},
+      IFB_CREATE_USER = #{record.createUser,jdbcType=VARCHAR}
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.minpay.db.table.model.ImItemFunctionBranch" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update im_item_function_branch
+    <set >
+      <if test="branch != null" >
+        IFB_BRANCH = #{branch,jdbcType=VARCHAR},
+      </if>
+      <if test="functionId != null" >
+        IFB_FUNCTION_ID = #{functionId,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        IFB_CREATE_TIME = #{createTime,jdbcType=VARCHAR},
+      </if>
+      <if test="createUser != null" >
+        IFB_CREATE_USER = #{createUser,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where IFB_ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.minpay.db.table.model.ImItemFunctionBranch" >
+    <!--
+      WARNING - @mbggenerated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update im_item_function_branch
+    set IFB_BRANCH = #{branch,jdbcType=VARCHAR},
+      IFB_FUNCTION_ID = #{functionId,jdbcType=VARCHAR},
+      IFB_CREATE_TIME = #{createTime,jdbcType=VARCHAR},
+      IFB_CREATE_USER = #{createUser,jdbcType=VARCHAR}
+    where IFB_ID = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 9 - 0
src/main/resources/com/minpay/db/table/own/mapper/BranchManageMapper.xml

@@ -196,4 +196,13 @@
 			 BRH_ID= (#{branchId,jdbcType=VARCHAR})
 		</if>
 	</update>
+	<select id="queryPower" resultType="hashmap" parameterType="java.util.Map">
+		SELECT
+			IIF_ID 		AS "menuid",
+			IIF_NAME 	AS "menuidname",
+			IFB_FUNCTION_ID as "funMenuidId"
+		FROM im_item_function
+		left join im_item_function_branch on IFB_FUNCTION_ID = IIF_ID and IFB_BRANCH = #{branchId,jdbcType=VARCHAR}
+		ORDER BY IIF_ID
+	</select>
 </mapper>

+ 31 - 8
src/main/webapp/admin/departmentManage/departmentManage.html

@@ -55,7 +55,7 @@
 		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="enable">解冻</a>
 		{{#  }; }}
 		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
-
+		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="power">权限</a>
    </script>
 	<script>
      	var table;
@@ -70,15 +70,15 @@
 			    ,where:{MINView:"JSON"}
 			    ,page: true //开启分页
 			    ,cols: [[ //表头
-			    	 {field: 'id', type: 'numbers', title: '序号'}
-			     	,{field: 'branchId', title: '编号', width:'8%', sort: true}
-			     	,{field: 'name', title: '商户名称', width:'15%',sort: true}
-			      	,{field: 'count', title: '操作员人数', width:'12%'}
-					,{field: 'person', title: '联系人', width:'10%'}
+			    	{field: 'num', title: '序号',width:'8%', type:'numbers', fixed: true, align: 'center'}
+			     	,{field: 'branchId', title: '编号', width:'10%', sort: true, fixed: 'left'}
+			     	,{field: 'name', title: '商户名称', width:'15%',sort: true, fixed: 'left'}
+			      	,{field: 'count', title: '操作员人数', width:'8%'}
+					,{field: 'person', title: '联系人', width:'8%'}
 					,{field: 'phone', title: '联系方式', width:'10%'}
-			     	,{field: 'desc', title: '备注', width:'20%', sort: true}
+			     	,{field: 'desc', title: '备注', width:'13%', sort: true}
 			      	,{field: 'sttdesc', title: '状态', width:'8%', sort: true}
-			      	,{field: 'operate', title: '操作', width: '15%', toolbar: '#barDemo'}
+			      	,{field: 'operate', title: '操作', width: '20%', toolbar: '#barDemo'}
 		    	]]
 		    	,done: function(res, curr, count){
 		        	//如果是异步请求数据方式,res即为你接口返回的信息。
@@ -138,6 +138,8 @@
 		      		});
 			  	} else if(layEvent === 'edit'){ //编辑
 			    	editDetail(data);
+			  	} else if(layEvent === 'power'){ //权限
+			  		updatePower(data);
 			  	}else if(layEvent === 'frozen'){ //冻结
 
 					layer.confirm('是否确定要删除该商户?', function(index){
@@ -196,6 +198,27 @@
 				active[type] ? active[type].call(this) : '';
 			});    
 		});
+
+		function updatePower(data) {
+    	  var params = {};
+	    	params.columnNumber = 2; //每行显示两个字段
+	    	// 要显示的数据
+	    	params.fields = [{field: 'branchId', title: '编号'},
+	    	                 {field: 'name', title: '商户名称'}
+	    	                 ];
+		    // 寄存当前数据
+		    setNowRowData(data, params);
+	    	layer.open({
+	    	      type: 2,
+	    	      title: '权限修改',
+	    	      shadeClose: true,
+	    	      shade:0.8,
+	    	      //maxmin: true, //开启最大化最小化按钮
+	    	      area: ['75%', '85%'],
+	    	      content: '../../admin/departmentManage/departmentUpdate.html'
+	    	});
+      }
+
      	//查询详情
 		function showDetail(data) {
     	  	var params = {};

+ 187 - 0
src/main/webapp/admin/departmentManage/departmentUpdate.html

@@ -0,0 +1,187 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>权限管理</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<body class="content">
+	<form class="layui-form" id = "formName" >
+    <div style="margin-top: 20px;margin-left: 20px;margin-right: 120px;padding-bottom:60px;" >
+    	  <div class="layui-form-item">
+		    <label class="layui-form-label">编号</label>
+		    <div class="layui-input-block">
+		      <input type="text" name="roleId" id="roleId" disabled="disabled" autocomplete="off" class="layui-input">
+		    </div>
+		  </div>
+    	  <div class="layui-form-item">
+		    <label class="layui-form-label">商户名称</label>
+		    <div class="layui-input-block">
+		      <input type="text" name="name" id="name" autocomplete="off" class="layui-input">
+		    </div>
+		  </div>
+      </div>
+      </form>
+		<div style="margin-top: 20px;margin-left: 20px;margin-right: 120px;"> 
+			<table class="layui-table" style="margin-top: 20px;margin-left: 20px;margin-right: 120px; margin-bottom: 80px;">
+		       	<thead>
+		       		<tr>
+		       			<th id="selectTr"></th>
+		       			<th>一级栏目</th>
+		       		</tr>
+		       	</thead>
+	       		<tbody id="tbody">
+	       		</tbody>
+       		</table>
+    	</div>
+       	<div class="layui-form-item box-button">
+           <div class="layui-input-block">
+               <button class="layui-btn" onclick = "updateRole()">提交</button>
+           </div>
+       	</div>
+	<script src="../../js/min-loader-next.js"></script>
+    <!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
+    <script>
+	    var params = layui.sessionData("ROW_DATA").NOW_ROW.params;
+		var fields = params.fields;
+		var roleId = layui.sessionData("ROW_DATA").NOW_ROW["branchId"];
+		var name = layui.sessionData("ROW_DATA").NOW_ROW["name"];
+		$("#roleId").val(roleId);
+		$("#name").val(name);
+		// checkbox 点击事件
+        function authChoose(t){
+        	var val = t.value;
+        	var isChecked = t.checked;
+        	var inputs = document.getElementsByName(t.name);
+        	// 主菜单
+        	if (isEmpty(val)) {
+        		for (var i = 0; i < inputs.length; i ++) {
+        			inputs[i].checked = isChecked;
+        		}
+        	// 单个菜单
+        	} else {
+        		// 是否全选
+        		var isAllFlag = true;
+        		for (var i = 0; i < inputs.length; i ++) {
+        			if (!inputs[i].checked && !isEmpty(inputs[i].value)) {
+        				isAllFlag = false;
+        				break;
+        			}
+        		}
+        		if (isAllFlag) {
+        			inputs[0].checked = true;
+        		} else {
+        			inputs[0].checked = false;
+        		}
+        	}
+        	//处理全选框问题
+			var checkedAll = true;
+			$('#tbody').find(':checkbox').each(function(){
+				if( !this.checked ){
+					checkedAll = false;
+					return false;
+				}
+			});
+			$("#selectAll").prop('checked',checkedAll);
+       	}
+
+        // 新增角色按钮
+        function updateRole(){
+        	var itemid = "";//菜单
+        	var authCheck = false;
+        	$('#tbody').find("tr").each(function(){
+        		if($(this).find("td:eq(0)").find(":checkbox").prop('checked')){
+					itemid += $(this).find("input:checkbox").eq(0).val() + "," ;//拼接菜单信息
+        		}
+       		});
+        	if(authCheck){
+        		return ;
+        	}
+        	// 执行修改
+        	$.request({
+        		action : '../../DepartmentManageAction/powerModify',
+        		data : {
+					itemidStrs : itemid,
+					branchId : roleId
+        		},
+        		success : function(data){
+        			if (data.MINStatus == 0) {
+        				layui.use(['layer'], function(){
+        					layer.msg('修改成功!', {
+       							icon: 1,
+       							time: 3000 //2秒关闭(如果不配置,默认是3秒)
+       						}, function(){
+       							parent.location.reload();
+       						});
+                		})
+        			} else {
+        				layui.use(['layer'], function(){
+                			layer.alert(data.MINErrorMessage, {icon: 2});
+                		})
+        			}
+        		},
+        		error : function(data) {
+        			layui.use(['layer'], function(){
+            			layer.alert(data.MINErrorMessage, {icon: 2});
+            		})
+        		}
+        	})
+        }
+        function checkAll(checked){
+       		$('#tbody').find(':checkbox').each(function(){
+				$(this).prop('checked', checked); 
+       		});
+        }
+
+        $(document).ready(function(){
+        	$("#selectTr").html("<input type='checkbox' id='selectAll' onclick='checkAll(this.checked);'> ");
+        	// 查询菜单
+        	$.request({
+        		action : '../../DepartmentManageAction/queryPower',
+        		data : {
+					branchId : roleId
+        		},
+        		success : function(data){
+        			var menu = data.MINQueryResult;
+        			var html = "";
+        			// 一级菜单临时html
+        			var onelevelHtmlPartOne = "";
+        			var onelevelHtmlPartTwo = "";
+        			// 一级菜单是否被选中
+        			var onelevelIsChecked = "";
+        			for (var i = 0; i < menu.length; i ++) {
+        				// 一级菜单
+						html += (onelevelHtmlPartOne + onelevelIsChecked + onelevelHtmlPartTwo);
+						onelevelIsChecked = "";
+						// 清空标示
+						var menuId = menu[i].menuid;
+						var menuName = menu[i].menuidname;
+						var checkParam = menu[i].funMenuidId;
+						if(menuId == checkParam) {
+							onelevelIsChecked = "checked";
+						}
+						onelevelHtmlPartOne = '<tr>' +
+											'<td><input type="checkbox" lay-skin="primary" name='+menu[i].menuid+' value='+menu[i].menuid+' onclick="authChoose(this)" ';
+						onelevelHtmlPartTwo = '></td>' +
+											'<td>'+menu[i].menuidname+'</td>' +
+										'</tr>';
+        				// 最后一个一级菜单
+        				if (i == menu.length - 1) {
+        					html += (onelevelHtmlPartOne + onelevelIsChecked + onelevelHtmlPartTwo);
+        				}
+        			}
+        			$("#tbody").append(html);
+        		},
+        		error : function(data) {
+        			layui.use(['layer'], function(){
+            			layer.alert(data.MINErrorMessage, {icon: 2});
+            		})
+        		}
+        	})
+        })
+    </script>
+</body>
+</html>