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

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

parent 7465d894
...@@ -50,7 +50,17 @@ public class CurrentRiskPost extends BaseEntityClean ...@@ -50,7 +50,17 @@ public class CurrentRiskPost extends BaseEntityClean
/** 删除标志(0代表存在 1代表删除) */ /** 删除标志(0代表存在 1代表删除) */
private String delFlag; 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; this.id = id;
} }
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.censoft.censoftrongtong.mapper.CurrentRiskPostMapper"> <mapper namespace="com.censoft.censoftrongtong.mapper.CurrentRiskPostMapper">
<resultMap type="com.censoft.censoftrongtong.domain.CurrentRiskPost" id="CurrentRiskPostResult"> <resultMap type="com.censoft.censoftrongtong.domain.CurrentRiskPost" id="CurrentRiskPostResult">
<result property="id" column="id" /> <result property="id" column="id"/>
<result property="projectId" column="project_id" /> <result property="projectId" column="project_id"/>
<result property="riskPostCode" column="risk_post_code" /> <result property="riskPostCode" column="risk_post_code"/>
<result property="riskPostName" column="risk_post_name" /> <result property="riskPostName" column="risk_post_name"/>
<result property="patrolType" column="patrol_type" /> <result property="patrolType" column="patrol_type"/>
<result property="riskPostDesc" column="risk_post_desc" /> <result property="riskPostDesc" column="risk_post_desc"/>
<result property="userId" column="user_id" /> <result property="userId" column="user_id"/>
<result property="sortNum" column="sort_num" /> <result property="sortNum" column="sort_num"/>
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark" /> <result property="remark" column="remark"/>
<result property="nickName" column="nickName"/>
</resultMap> </resultMap>
<sql id="selectCurrentRiskPostVo"> <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> </sql>
<select id="selectCurrentRiskPostList" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost" resultMap="CurrentRiskPostResult"> <select id="selectCurrentRiskPostList" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost"
<include refid="selectCurrentRiskPostVo"/> resultMap="CurrentRiskPostResult">
<where> SELECT
<if test="projectId != null "> and project_id = #{projectId}</if> a.id,
<if test="riskPostCode != null and riskPostCode != ''"> and risk_post_code = #{riskPostCode}</if> project_id,
<if test="riskPostName != null and riskPostName != ''"> and risk_post_name like concat('%', #{riskPostName}, '%')</if> risk_post_code,
<if test="patrolType != null and patrolType != ''"> and patrol_type = #{patrolType}</if> risk_post_name,
<if test="riskPostDesc != null and riskPostDesc != ''"> and risk_post_desc = #{riskPostDesc}</if> patrol_type,
<if test="userId != null and userId != ''"> and user_id = #{userId}</if> risk_post_desc,
<if test="sortNum != null "> and sort_num = #{sortNum}</if> 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> </where>
</select> </select>
<select id="selectCurrentRiskPostById" parameterType="Long" resultMap="CurrentRiskPostResult"> <select id="selectCurrentRiskPostById" parameterType="Long" resultMap="CurrentRiskPostResult">
<include refid="selectCurrentRiskPostVo"/> <include refid="selectCurrentRiskPostVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost"> <insert id="insertCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost">
insert into current_risk_post insert into current_risk_post
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -60,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -60,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="projectId != null">#{projectId},</if> <if test="projectId != null">#{projectId},</if>
...@@ -76,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -76,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
</trim> </trim>
</insert> </insert>
<update id="updateCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost"> <update id="updateCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost">
...@@ -100,11 +131,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,11 +131,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteCurrentRiskPostById" parameterType="Long"> <delete id="deleteCurrentRiskPostById" parameterType="Long">
delete from current_risk_post where id = #{id} delete
from current_risk_post
where id = #{id}
</delete> </delete>
<delete id="deleteCurrentRiskPostByIds" parameterType="String"> <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=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </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