项目管理模块优化

This commit is contained in:
LHD_HY 2025-12-30 15:23:27 +08:00
parent 1fdc18dfc0
commit 68e3c988e3
1 changed files with 44 additions and 36 deletions

View File

@ -8,8 +8,6 @@
<id property="proId" column="id" />
<result property="proName" column="pro_name" />
<result property="proType" column="pro_type" />
<result property="unitId" column="unit_id" />
<result property="unit" column="unit_name" />
<result property="chargePerson" column="user_name" />
<result property="location" column="pro_location" />
<result property="longitude" column="lon" />
@ -25,25 +23,20 @@
<sql id="selectProject">
SELECT
tp.id,
tp.pro_name,
sdd.type_name as pro_type,
oo.id as unit_id,
oo.unit_name,
tp.user_name,
tp.pro_location,
tp.lon,
tp.lat,
tp.remark,
sc.config_name
LEVEL
tp.id,
tp.pro_name,
tp.pro_type,
tp.user_name,
tp.pro_location,
tp.lon,
tp.lat,
tp.remark,
sc.config_name AS LEVEL
FROM
tb_project tp
LEFT JOIN sys_level_config sc ON sc.config_id = tp.LEVEL
LEFT JOIN tb_pro_type sdd ON sdd.id = tp.pro_type
LEFT JOIN tb_owner oo on oo.id = tp.unit_id
tb_project tp
LEFT JOIN sys_level_config sc ON sc.config_id = tp.LEVEL
WHERE
del_flag = '0'
del_flag = '0'
</sql>
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
@ -57,41 +50,55 @@
<if test="proId != null">
AND tp.id = #{proId}
</if>
<if test="unit != null and unit != ''">
AND unit_id = #{unit}
</if>
<!-- 移除业主单位相关查询条件 -->
<if test="chargePerson != null and chargePerson != ''">
AND user_name like concat('%', #{chargePerson}, '%')
</if>
</select>
<select id="selectProjectById" parameterType="Long" resultMap="ProjectResult">
select tp.id, tp.pro_name, tp.pro_type,oo.id as unit_id, oo.unit_name,tp.user_name, tp.pro_location, tp.remark,tp.lon,tp.lat
select
tp.id,
tp.pro_name,
tp.pro_type,
tp.user_name,
tp.pro_location,
tp.remark,
tp.lon,
tp.lat
from tb_project tp
LEFT JOIN tb_pro_type sdd ON sdd.id = tp.pro_type
LEFT JOIN tb_owner oo on oo.id = tp.unit_id
where tp.del_flag = '0' and tp.id = #{proId}
</select>
<select id="checkProjectNameUnique" parameterType="String" resultMap="ProjectResult">
select id, pro_name, pro_type, user_name, pro_location, remark
select
id,
pro_name,
pro_type,
user_name,
pro_location,
remark
from tb_project
where del_flag = '0' and pro_name=#{proName} limit 1
</select>
<select id="checkProjectUserUnique" resultType="com.bonus.waterdesign.domain.ProjectUser">
select project_id,user_id from tb_project_user where user_id = #{userId}
</select>
<select id="selectProjectUserList" resultType="com.bonus.waterdesign.domain.ProjectUser">
select tpu.user_id as userId, su.user_name as userName,su.phonenumber as phonenumber,
sr.role_name as roleName
select
tpu.user_id as userId,
su.user_name as userName,
su.phonenumber as phonenumber,
sr.role_name as roleName
from tb_project_user tpu
left join sys_user su on tpu.user_id = su.user_id
left join sys_user_role sur on sur.user_id = su.user_id
left join sys_role sr on sr.role_id = sur.role_id
<where>
<if test="projectId != null ">
and tpu.project_id = #{projectId}
and tpu.project_id = #{projectId}
</if>
<if test="userName != null and userName != ''">
and su.user_name like CONCAT('%', #{userName}, '%')
@ -101,6 +108,7 @@
</if>
</where>
</select>
<select id="selectProjectList1" resultType="com.bonus.waterdesign.domain.ProjectSelect">
SELECT
tp.id,
@ -117,6 +125,7 @@
AND tp.id = #{id}
</if>
</select>
<select id="proTypeSelect" resultType="com.bonus.waterdesign.domain.SelectDto">
SELECT
tp.type_name as name,
@ -130,7 +139,6 @@
<set>
<if test="proName != null and proName != ''">pro_name = #{proName},</if>
<if test="proType != null and proType != ''">pro_type = #{proType},</if>
<if test="unit != null and unit != ''">unit_id = #{unit},</if>
<if test="chargePerson != null and chargePerson != ''">user_name = #{chargePerson},</if>
<if test="location != null and location != ''">pro_location = #{location},</if>
<if test="longitude != null and longitude != ''">lon = #{longitude},</if>
@ -147,7 +155,6 @@
<if test="proId != null and proId != 0">id,</if>
<if test="proName != null and proName != ''">pro_name,</if>
<if test="proType != null and proType != ''">pro_type,</if>
<if test="unit != null and unit != ''">unit_id,</if>
<if test="chargePerson != null and chargePerson != ''">user_name,</if>
<if test="location != null and location != ''">pro_location,</if>
<if test="longitude != null and longitude != ''">lon,</if>
@ -160,7 +167,6 @@
<if test="proId != null and proId != 0">#{proId},</if>
<if test="proName != null and proName != ''">#{proName},</if>
<if test="proType != null and proType != ''">#{proType},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="chargePerson != null and chargePerson != ''">#{chargePerson},</if>
<if test="location != null and location != ''">#{location},</if>
<if test="longitude != null and longitude != ''">#{longitude},</if>
@ -171,10 +177,12 @@
sysdate()
)
</insert>
<insert id="insertProjectUser">
insert into tb_project_user (project_id,user_id) values (#{projectId},#{userId})
</insert>
<insert id="insertCadData">
<insert id="insertCadData">
INSERT INTO cad_data (
layer_name, entity_type, color, lineweight,
thickness, transparency, start_point, end_point,
@ -186,15 +194,15 @@
)
</insert>
<delete id="deleteProjectById" parameterType="Long">
<delete id="deleteProjectById" parameterType="Long">
UPDATE `tb_project` SET
del_flag = '1'
WHERE
id = #{proId}
</delete>
<delete id="delProjectUser">
delete from tb_project_user where user_id = #{userId}
</delete>
</mapper>