Browse Source

Merge pull request 'ly' (#2) from ly into KH

Reviewed-on: http://8.137.125.67:4000/SwtTt29/web-follow/pulls/2
hzj
ly 2 months ago
parent
commit
67dafebb03
  1. 9
      web/src/main/java/com/example/web/entity/Users.java
  2. 54
      web/src/main/resources/mapper/UsersMapper.xml
  3. 1134
      web/src/main/resources/static/index.html
  4. 2
      web/src/test/java/com/example/WebApplicationTests.java

9
web/src/main/java/com/example/web/entity/Users.java

@ -29,6 +29,7 @@ public class Users {
private LocalDateTime updated_at;//更新时间
private String company;//客户公司
private String region;//客户地区
private String detailedaddress;//详细地址
private String level;//客户等级
private String demand;//客户需求
private String spec;//规格
@ -176,6 +177,14 @@ public class Users {
this.region = region;
}
public String getDetailedaddress() {
return detailedaddress;
}
public void setDetailedaddress(String detailedaddress) {
this.detailedaddress = detailedaddress;
}
public String getLevel() {
return level;
}

54
web/src/main/resources/mapper/UsersMapper.xml

@ -14,6 +14,9 @@
<if test="userName != null and userName != ''">
AND um.userName = #{userName}
</if>
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
<if test="managercompany != null and managercompany != ''">
AND um.managercompany = #{managercompany}
</if>
@ -45,6 +48,9 @@
<if test="userName != null and userName != ''">
AND um.userName = #{userName}
</if>
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
<if test="managercompany != null and managercompany != ''">
AND um.managercompany = #{managercompany}
</if>
@ -74,12 +80,15 @@
AND role = #{role}
)
AND u.type != 'Colleague'
<if test="managerName != null and managerName != ''">
AND EXISTS (SELECT 1 FROM usermanagements um WHERE um.userId = u.userId AND um.userName = #{managerName})
</if>
ORDER BY u.created_at DESC
LIMIT #{offset}, #{limit}
</select>
<select id="countByUserIds" resultType="java.lang.Integer">
SELECT COUNT(*) FROM users
WHERE userId IN
SELECT COUNT(*) FROM users u
WHERE u.userId IN
(
SELECT userId FROM usermanagements
WHERE userName = #{userName}
@ -88,7 +97,10 @@
AND organization = #{organization}
AND role = #{role}
)
AND type != 'Colleague'
AND u.type != 'Colleague'
<if test="managerName != null and managerName != ''">
AND EXISTS (SELECT 1 FROM usermanagements um WHERE um.userId = u.userId AND um.userName = #{managerName})
</if>
</select>
<select id="findPublicWithPagination" resultType="com.example.web.entity.Users">
@ -123,6 +135,9 @@
OR (um.organization IS NOT NULL AND um.organization != '')
OR (um.role IS NOT NULL AND um.role != '')
OR (um.userName IS NOT NULL AND um.userName != ''))
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
ORDER BY u.created_at DESC
LIMIT #{offset}, #{limit}
</select>
@ -136,21 +151,32 @@
OR (um.organization IS NOT NULL AND um.organization != '')
OR (um.role IS NOT NULL AND um.role != '')
OR (um.userName IS NOT NULL AND um.userName != ''))
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
</select>
<select id="findPersonalWithPagination" resultType="com.example.web.entity.Users">
SELECT * FROM users
SELECT u.*, um.userName as managerName FROM users u
JOIN usermanagements um ON u.userId = um.userId
WHERE followup IS NOT NULL AND followup != ''
AND (sync_statuss IS NULL OR sync_statuss NOT IN (0, 1))
AND type != 'Colleague'
AND type != 'Colleague'
AND (u.sync_statuss IS NULL OR u.sync_statuss NOT IN (0, 1))
AND u.type != 'Colleague'
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
ORDER BY u.created_at DESC
LIMIT #{offset}, #{limit}
</select>
<select id="countPersonal" resultType="java.lang.Integer">
SELECT COUNT(*) FROM users
WHERE followup IS NOT NULL AND followup != ''
AND (sync_statuss IS NULL OR sync_statuss NOT IN (0, 1))
SELECT COUNT(*) FROM users u
JOIN usermanagements um ON u.userId = um.userId
WHERE u.followup IS NOT NULL AND u.followup != ''
AND (u.sync_statuss IS NULL OR u.sync_statuss NOT IN (0, 1))
<if test="managerName != null and managerName != ''">
AND um.userName = #{managerName}
</if>
</select>
<select id="findPublicAllWithPagination" resultType="com.example.web.entity.Users">
@ -180,7 +206,13 @@
<update id="updateFollowup" parameterType="java.util.Map">
UPDATE users
SET followup = #{followup},
followup_at = NOW()
followup_at = NOW(),
type = #{type},
level = #{level},
detailedaddress = #{detailedaddress},
company = #{company},
demand = #{demand},
region = #{region}
WHERE userId = #{userId}
</update>

1134
web/src/main/resources/static/index.html

File diff suppressed because it is too large

2
web/src/test/java/com/example/WebApplicationTests.java

@ -3,7 +3,7 @@ package com.example;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
@SpringBootTest(classes = com.example.web.WebApplication.class)
class WebApplicationTests {
@Test

Loading…
Cancel
Save