Commit 017ad585 authored by 鲍德's avatar 鲍德

风险巡查项目岗位返回增加用户姓名

parent 7465d894
......@@ -50,7 +50,17 @@ public class CurrentRiskPost extends BaseEntityClean
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
public void setId(Long id)
private String nickName;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public void setId(Long id)
{
this.id = id;
}
......
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.censoft.censoftrongtong.mapper.CurrentRiskPostMapper">
<resultMap type="com.censoft.censoftrongtong.domain.CurrentRiskPost" id="CurrentRiskPostResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="riskPostCode" column="risk_post_code" />
<result property="riskPostName" column="risk_post_name" />
<result property="patrolType" column="patrol_type" />
<result property="riskPostDesc" column="risk_post_desc" />
<result property="userId" column="user_id" />
<result property="sortNum" column="sort_num" />
<result property="delFlag" column="del_flag" />
<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="remark" column="remark" />
<result property="id" column="id"/>
<result property="projectId" column="project_id"/>
<result property="riskPostCode" column="risk_post_code"/>
<result property="riskPostName" column="risk_post_name"/>
<result property="patrolType" column="patrol_type"/>
<result property="riskPostDesc" column="risk_post_desc"/>
<result property="userId" column="user_id"/>
<result property="sortNum" column="sort_num"/>
<result property="delFlag" column="del_flag"/>
<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="remark" column="remark"/>
<result property="nickName" column="nickName"/>
</resultMap>
<sql id="selectCurrentRiskPostVo">
select id, project_id, risk_post_code, risk_post_name, patrol_type, risk_post_desc, user_id, sort_num, del_flag, create_by, create_time, update_by, update_time, remark from current_risk_post
select id,
project_id,
risk_post_code,
risk_post_name,
patrol_type,
risk_post_desc,
user_id,
sort_num,
del_flag,
create_by,
create_time,
update_by,
update_time,
remark
from current_risk_post
</sql>
<select id="selectCurrentRiskPostList" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost" resultMap="CurrentRiskPostResult">
<include refid="selectCurrentRiskPostVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="riskPostCode != null and riskPostCode != ''"> and risk_post_code = #{riskPostCode}</if>
<if test="riskPostName != null and riskPostName != ''"> and risk_post_name like concat('%', #{riskPostName}, '%')</if>
<if test="patrolType != null and patrolType != ''"> and patrol_type = #{patrolType}</if>
<if test="riskPostDesc != null and riskPostDesc != ''"> and risk_post_desc = #{riskPostDesc}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="sortNum != null "> and sort_num = #{sortNum}</if>
<select id="selectCurrentRiskPostList" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost"
resultMap="CurrentRiskPostResult">
SELECT
a.id,
project_id,
risk_post_code,
risk_post_name,
patrol_type,
risk_post_desc,
a.user_id,
sort_num,
a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
GROUP_CONCAT(b.nick_name) nickName
FROM
current_risk_post a
LEFT JOIN sys_user b on FIND_IN_SET(b.user_id,a.user_id)
<where>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="riskPostCode != null and riskPostCode != ''">and risk_post_code = #{riskPostCode}</if>
<if test="riskPostName != null and riskPostName != ''">and risk_post_name like concat('%', #{riskPostName},
'%')
</if>
<if test="patrolType != null and patrolType != ''">and patrol_type = #{patrolType}</if>
<if test="riskPostDesc != null and riskPostDesc != ''">and risk_post_desc = #{riskPostDesc}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="sortNum != null ">and sort_num = #{sortNum}</if>
</where>
</select>
<select id="selectCurrentRiskPostById" parameterType="Long" resultMap="CurrentRiskPostResult">
<include refid="selectCurrentRiskPostVo"/>
where id = #{id}
</select>
<insert id="insertCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost">
insert into current_risk_post
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -60,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="projectId != null">#{projectId},</if>
......@@ -76,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</trim>
</insert>
<update id="updateCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost">
......@@ -100,11 +131,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteCurrentRiskPostById" parameterType="Long">
delete from current_risk_post where id = #{id}
delete
from current_risk_post
where id = #{id}
</delete>
<delete id="deleteCurrentRiskPostByIds" parameterType="String">
delete from current_risk_post where id in
delete from current_risk_post where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment