Pārlūkot izejas kodu

营收管理端用户增加身份。

zhengqiang 4 gadi atpakaļ
vecāks
revīzija
756b7cdd33

+ 23 - 21
common/src/main/java/com/jpsoft/bus/modules/merchant/entity/AccountInfo.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,46 +12,47 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 
 /**
-  描述:merchant_account_info的实体类
+ * 描述:merchant_account_info的实体类
  */
 @Data
 @ApiModel(value = "merchant_account_info的实体类")
 public class AccountInfo {
-        @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "")
     private String id;
-        @ApiModelProperty(value = "商户名称")
+    @ApiModelProperty(value = "商户名称")
     private String name;
-        @ApiModelProperty(value = "关联的公司车队")
+    @ApiModelProperty(value = "关联的公司车队")
     private String companyId;
-        @ApiModelProperty(value = "微信openId")
+    @ApiModelProperty(value = "微信openId")
     private String openId;
-        @ApiModelProperty(value = "手机号")
+    @ApiModelProperty(value = "手机号")
     private String phone;
-        @ApiModelProperty(value = "提现许可(0:不可提现,1:可提现)")
+    @ApiModelProperty(value = "提现许可(0:不可提现,1:可提现)")
     private Boolean withdrawAllow;
-        @ApiModelProperty(value = "商户冻结(0:未冻结,1:已冻结)")
+    @ApiModelProperty(value = "商户冻结(0:未冻结,1:已冻结)")
     private Boolean frozen;
-        @ApiModelProperty(value = "头像")
+    @ApiModelProperty(value = "头像")
     private String imageUrl;
-        @ApiModelProperty(value = "银行名称")
+    @ApiModelProperty(value = "银行名称")
     private String bankName;
-        @ApiModelProperty(value = "银行卡账号")
+    @ApiModelProperty(value = "银行卡账号")
     private String bankNumber;
-        @ApiModelProperty(value = "创建人")
+    @ApiModelProperty(value = "创建人")
     private String createBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "创建时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
     private Date createTime;
-        @ApiModelProperty(value = "更新人")
+    @ApiModelProperty(value = "更新人")
     private String updateBy;
-        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-	    @ApiModelProperty(value = "更新时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
-        @ApiModelProperty(value = "是否删除")
+    @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
-
     @ApiModelProperty(value = "关联的公司车队")
     private String companyName;
+    @ApiModelProperty(value = "身份(1-司机、2-车主、3-车队长、4-管理人员)")
+    private String roles;
 }

+ 146 - 140
common/src/main/resources/mapper/merchant/AccountInfo.xml

@@ -1,123 +1,129 @@
 <?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">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.bus.modules.merchant.dao.AccountInfoDAO">
-	<resultMap id="AccountInfoMap" type="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
-		<id property="id" column="id_" />
-			<result property="name" column="name_" />
-			<result property="companyId" column="company_id" />
-			<result property="openId" column="open_id" />
-			<result property="phone" column="phone_" />
-			<result property="withdrawAllow" column="withdraw_allow" />
-			<result property="frozen" column="frozen_" />
-			<result property="imageUrl" column="image_url" />
-			<result property="bankName" column="bank_name" />
-			<result property="bankNumber" column="bank_number" />
-			<result property="createBy" column="create_by" />
-			<result property="createTime" column="create_time" />
-			<result property="updateBy" column="update_by" />
-			<result property="updateTime" column="update_time" />
-			<result property="delFlag" column="del_flag" />
-			<result property="companyName" column="company_name" />
-			</resultMap>
-	<insert id="insert" parameterType="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+    <resultMap id="AccountInfoMap" type="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
+        <id property="id" column="id_"/>
+        <result property="name" column="name_"/>
+        <result property="companyId" column="company_id"/>
+        <result property="openId" column="open_id"/>
+        <result property="phone" column="phone_"/>
+        <result property="withdrawAllow" column="withdraw_allow"/>
+        <result property="frozen" column="frozen_"/>
+        <result property="imageUrl" column="image_url"/>
+        <result property="bankName" column="bank_name"/>
+        <result property="bankNumber" column="bank_number"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="companyName" column="company_name"/>
+        <result property="roles" column="roles_"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
 		insert into merchant_account_info
-	    (id_,name_,company_id,open_id,phone_,withdraw_allow,frozen_,image_url,bank_name,bank_number,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,name_,company_id,open_id,phone_,withdraw_allow,frozen_,image_url,bank_name,bank_number,
+	    create_by,create_time,update_by,update_time,del_flag,roles_)
 		values
 		(
-#{id,jdbcType=VARCHAR}
-,#{name,jdbcType=VARCHAR}
-,#{companyId,jdbcType=VARCHAR}
-,#{openId,jdbcType=VARCHAR}
-,#{phone,jdbcType=VARCHAR}
-,#{withdrawAllow,jdbcType= NUMERIC }
-,#{frozen,jdbcType= NUMERIC }
-,#{imageUrl,jdbcType=VARCHAR}
-,#{bankName,jdbcType=VARCHAR}
-,#{bankNumber,jdbcType=VARCHAR}
-,#{createBy,jdbcType=VARCHAR}
-,#{createTime,jdbcType= TIMESTAMP }
-,#{updateBy,jdbcType=VARCHAR}
-,#{updateTime,jdbcType= TIMESTAMP }
-,#{delFlag,jdbcType= NUMERIC }
+            #{id,jdbcType=VARCHAR}
+            ,#{name,jdbcType=VARCHAR}
+            ,#{companyId,jdbcType=VARCHAR}
+            ,#{openId,jdbcType=VARCHAR}
+            ,#{phone,jdbcType=VARCHAR}
+            ,#{withdrawAllow,jdbcType= NUMERIC }
+            ,#{frozen,jdbcType= NUMERIC }
+            ,#{imageUrl,jdbcType=VARCHAR}
+            ,#{bankName,jdbcType=VARCHAR}
+            ,#{bankNumber,jdbcType=VARCHAR}
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{updateTime,jdbcType= TIMESTAMP }
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{roles,jdbcType=VARCHAR}
 		)
 	]]>
-	</insert>
-	<delete id="delete" parameterType="string">
-		delete from merchant_account_info where id_=#{id,jdbcType=VARCHAR}
-	</delete>
-	<update id="update" parameterType="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
-		update merchant_account_info
-		<set>
-				<if test="name!=null">
-		name_=#{name,jdbcType=VARCHAR},
-		</if>
-				<if test="companyId!=null">
-		company_id=#{companyId,jdbcType=VARCHAR},
-		</if>
-				<if test="openId!=null">
-		open_id=#{openId,jdbcType=VARCHAR},
-		</if>
-				<if test="phone!=null">
-		phone_=#{phone,jdbcType=VARCHAR},
-		</if>
-				<if test="withdrawAllow!=null">
-		withdraw_allow=#{withdrawAllow,jdbcType= NUMERIC },
-		</if>
-				<if test="frozen!=null">
-		frozen_=#{frozen,jdbcType= NUMERIC },
-		</if>
-				<if test="imageUrl!=null">
-		image_url=#{imageUrl,jdbcType=VARCHAR},
-		</if>
-				<if test="bankName!=null">
-		bank_name=#{bankName,jdbcType=VARCHAR},
-		</if>
-				<if test="bankNumber!=null">
-		bank_number=#{bankNumber,jdbcType=VARCHAR},
-		</if>
-				<if test="createBy!=null">
-		create_by=#{createBy,jdbcType=VARCHAR},
-		</if>
-				<if test="createTime!=null">
-		create_time=#{createTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="updateBy!=null">
-		update_by=#{updateBy,jdbcType=VARCHAR},
-		</if>
-				<if test="updateTime!=null">
-		update_time=#{updateTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="delFlag!=null">
-		del_flag=#{delFlag,jdbcType= NUMERIC },
-		</if>
-		</set>
-	where id_=#{id}
-	</update>
-	<select id="get" parameterType="string" resultMap="AccountInfoMap">
-		SELECT
-		a.*,
-		b.name_ AS company_name
-		FROM
-		merchant_account_info a
-		LEFT JOIN bus_company_info b ON a.company_id = b.id_
-		where a.id_=#{0}
-	</select>
-	<select id="exist" parameterType="string" resultType="int">
-		select count(*) from merchant_account_info where id_=#{0}
-	</select>
-	<select id="list" resultMap="AccountInfoMap">
-		select * from merchant_account_info
-	</select>
-	<select id="search" parameterType="hashmap" resultMap="AccountInfoMap">
-		<![CDATA[
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from merchant_account_info where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.merchant.entity.AccountInfo">
+        update merchant_account_info
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId!=null">
+                company_id=#{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="openId!=null">
+                open_id=#{openId,jdbcType=VARCHAR},
+            </if>
+            <if test="phone!=null">
+                phone_=#{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="withdrawAllow!=null">
+                withdraw_allow=#{withdrawAllow,jdbcType= NUMERIC },
+            </if>
+            <if test="frozen!=null">
+                frozen_=#{frozen,jdbcType= NUMERIC },
+            </if>
+            <if test="imageUrl!=null">
+                image_url=#{imageUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="bankName!=null">
+                bank_name=#{bankName,jdbcType=VARCHAR},
+            </if>
+            <if test="bankNumber!=null">
+                bank_number=#{bankNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="roles!=null">
+                roles_=#{roles,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="AccountInfoMap">
+        SELECT
+        a.*,
+        b.name_ AS company_name
+        FROM
+        merchant_account_info a
+        LEFT JOIN bus_company_info b ON a.company_id = b.id_
+        where a.id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from merchant_account_info where id_=#{0}
+    </select>
+    <select id="list" resultMap="AccountInfoMap">
+        select * from merchant_account_info
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="AccountInfoMap">
+        <![CDATA[
 			SELECT
 				a.*,
 				b.name_ AS company_name
@@ -125,43 +131,43 @@
 				merchant_account_info a
 				LEFT JOIN bus_company_info b ON b.id_ = a.company_id
 		]]>
-		<where>
-			a.del_flag = 0
-			<if test="searchParams.id != null">
-				and a.ID_ like #{searchParams.id}
-			</if>
-			<if test="searchParams.companyCode != null">
-				and b.code_ like #{searchParams.companyCode}
-			</if>
-			<if test="searchParams.name != null">
-				and a.name_ like #{searchParams.name}
-			</if>
-			<if test="searchParams.phone != null">
-				and a.phone_ like #{searchParams.phone}
-			</if>
-			<if test="searchParams.frozen != null">
-				and a.frozen_ = #{searchParams.frozen}
-			</if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
+        <where>
+            a.del_flag = 0
+            <if test="searchParams.id != null">
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.companyCode != null">
+                and b.code_ like #{searchParams.companyCode}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.phone != null">
+                and a.phone_ like #{searchParams.phone}
+            </if>
+            <if test="searchParams.frozen != null">
+                and a.frozen_ = #{searchParams.frozen}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
 
-	<select id="findByPhone" resultMap="AccountInfoMap">
-		<![CDATA[
+    <select id="findByPhone" resultMap="AccountInfoMap">
+        <![CDATA[
 		select  * from merchant_account_info
 		where del_flag = 0
 		and phone_ = #{phone}
 		]]>
-	</select>
+    </select>
 
-	<select id="findByOpenId" resultMap="AccountInfoMap">
-		<![CDATA[
+    <select id="findByOpenId" resultMap="AccountInfoMap">
+        <![CDATA[
 		select * from merchant_account_info
 		where del_flag = 0
 		and open_id = #{openId}
 		limit 1
 		]]>
-	</select>
+    </select>
 </mapper>