From 6e8c95d31d85b53857e4e3ce12ea303eb0ea42eb Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 19 八月 2021 00:47:48 +0800
Subject: [PATCH] 优化代码
---
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml | 45 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 2b96975..f5effc6
--- a/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
@@ -40,36 +40,46 @@
<!--淇濆瓨鏁版嵁鑷宠繃绋嬭〃 bo_cust 涓� -->
<insert id="saveDataToBoCust" parameterType="com.java110.entity.user.BoCust">
<![CDATA[
- insert into bo_cust(boId,custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,state)
- values(#{boId},#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{state})
+
+ insert into bo_cust(boId,custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,state)
+ values(#{boId},#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{state})
+
]]>
</insert>
<!-- 淇濆瓨鏁版嵁鑷宠繃绋嬭〃bo_cust_attr 涓�-->
<insert id="saveDataToBoCustAttr" parameterType="com.java110.entity.user.BoCustAttr">
<![CDATA[
- insert into bo_cust_attr(boId,custId,attrCd,value,state)
- values(#{boId},#{custId},#{attrCd},#{value},#{state})
+
+ insert into bo_cust_attr(boId,custId,attrCd,value,state)
+ values(#{boId},#{custId},#{attrCd},#{value},#{state})
+
]]>
</insert>
<!-- 淇濆瓨 瀹炰緥瀹㈡埛淇℃伅 cust -->
<insert id="saveDataToCust" parameterType="com.java110.entity.user.Cust">
<![CDATA[
- insert into cust(custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,status_cd)
- values(#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{status_cd})
+
+ insert into cust(custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,status_cd)
+ values(#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{status_cd})
+
]]>
</insert>
<!-- 鍒犻櫎瀹炰緥瀹㈡埛淇℃伅 cust -->
<insert id="deleteDataToCust" parameterType="com.java110.entity.user.Cust">
<![CDATA[
- delete * from cust c where c.custId = #{custId}
+
+ delete * from cust c where c.custId = #{custId}
+
]]>
</insert>
<!-- 淇濆瓨 瀹炰緥瀹㈡埛灞炴�т俊鎭� cust_attr -->
<insert id="saveDataToCustAttr" parameterType="com.java110.entity.user.CustAttr">
<![CDATA[
- insert into cust_attr(custId,attrCd,value,status_cd)
- values(#{custId},#{attrCd},#{value},#{status_cd})
+
+ insert into cust_attr(custId,attrCd,value,status_cd)
+ values(#{custId},#{attrCd},#{value},#{status_cd})
+
]]>
</insert>
<!-- 鍒犻櫎瀹炰緥瀹㈡埛淇℃伅 cust -->
@@ -204,6 +214,9 @@
</if>
<if test="tel !=null and tel != ''">
,u.tel= #{tel}
+ </if>
+ <if test="score !=null and score != ''">
+ ,u.score= #{score}
</if>
where 1 = 1
<if test="bId != null and bId != ''">
@@ -489,7 +502,8 @@
<select id="getStaffs" parameterType="Map" resultType="Map">
select uo.org_id orgId,uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name
userName,u.email,u.address,u.location_cd,u.location_cd locationCd,
- u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,puo.org_id parentOrgId,puo.org_name parentOrgName,puo.belong_community_id belongCommunityId,
+ u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,puo.org_id parentOrgId,puo.org_name
+ parentOrgName,puo.belong_community_id belongCommunityId,
uosr.store_id storeId,uosr.rel_cd relCd
from
u_user u
@@ -541,7 +555,7 @@
<select id="getUsers" parameterType="Map" resultType="Map">
select u.user_id, u.user_id userId,u.name,u.name
userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd,
- u.age,u.sex,u.tel,u.level_cd,u.b_id,u.level_cd levelCd
+ u.age,u.sex,u.tel,u.level_cd,u.b_id,u.level_cd levelCd,u.score
from u_user u
<if test="openId != null and openId !=''">
,u_user_attr ua
@@ -605,6 +619,15 @@
<if test="levelCd !=null and levelCd != ''">
and u.level_cd= #{levelCd}
</if>
+ <if test="levelCds != null">
+ and u.level_cd in
+ <foreach collection="levelCds" item="item" open="(" close=")" separator=",">
+ #{item}
+ </foreach>
+ </if>
+ <if test='userFlag !=null and userFlag =="1"'>
+ and u.level_cd != '02'
+ </if>
order by u.create_time desc
<if test="page != -1 and page != null ">
limit #{page}, #{row}
--
Gitblit v1.8.0