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