Browse Source

重构关注

master
陈裕财 4 years ago
parent
commit
c7fe0feec7
  1. 1
      xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java
  2. 5
      xm-core/src/main/java/com/xm/core/entity/XmMyFocus.java
  3. 12
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml

1
xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java

@ -95,6 +95,7 @@ public class XmMyFocusController {
}
xmMyFocus.setUserid(user.getUserid());
xmMyFocus.setUsername(user.getUsername());
if(xmMyFocusService.selectOneObject(xmMyFocus) !=null ){
return failed("pk-exists","编号重复,请修改编号再提交");
}

5
xm-core/src/main/java/com/xm/core/entity/XmMyFocus.java

@ -8,7 +8,7 @@ import java.util.Date;
/**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmMyFocus所有属性名: <br>
* "userid","用户编号","username","用户名称","bizId","关注的对象主键","focusType","对象类型:项目-1/任务-2/产品-3/需求-4/bug-5","pbizId","对象上级编号,项目时填项目编号,任务时填项目编号,产品时填产品编号,需求时填产品编号,bug时填产品编号","bizName","任务名称","pbizName","对象上级名称","ftime","关注时间";<br>
* "userid","用户编号","username","用户名称","bizId","关注的对象主键","focusType","对象类型:项目-1/任务-2/产品-3/需求-4/bug-5","pbizId","对象上级编号,项目时填项目编号,任务时填项目编号,产品时填产品编号,需求时填产品编号,bug时填产品编号","bizName","任务名称","pbizName","对象上级名称","ftime","关注时间","ubranchId","用户归属机构";<br>
* 当前主键(包括多主键):<br>
* userid,biz_id,pbiz_id;<br>
*/
@ -43,6 +43,9 @@ public class XmMyFocus implements java.io.Serializable {
@ApiModelProperty(notes="关注时间",allowEmptyValue=true,example="",allowableValues="")
Date ftime;
@ApiModelProperty(notes="用户归属机构",allowEmptyValue=true,example="",allowableValues="")
String ubranchId;
/**
*用户编号,关注的对象主键,对象上级编号,项目时填项目编号任务时填项目编号产品时填产品编号需求时填产品编号bug时填产品编号
**/

12
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml

@ -71,7 +71,7 @@
insert into xm_my_focus(
<include refid="columns"/>
) values (
#{userid},#{username},#{bizId},#{focusType},#{pbizId},#{bizName},#{pbizName},#{ftime}
#{userid},#{username},#{bizId},#{focusType},#{pbizId},#{bizName},#{pbizName},#{ftime},#{ubranchId}
)
</insert>
@ -146,7 +146,7 @@
<!--sql片段 列-->
<sql id="columns">
userid,username,biz_id,focus_type,pbiz_id,biz_name,pbiz_name,ftime
userid,username,biz_id,focus_type,pbiz_id,biz_name,pbiz_name,ftime,ubranch_id
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -159,6 +159,7 @@
<if test="bizName != null and bizName != ''"> and res.biz_name = #{bizName} </if>
<if test="pbizName != null and pbizName != ''"> and res.pbiz_name = #{pbizName} </if>
<if test="ftime != null"> and date_format(res.ftime,'%Y-%m-%d') = date_format(#{ftime},'%Y-%m-%d') </if>
<if test="ubranchId != null and ubranchId != ''"> and res.ubranch_id = #{ubranchId} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -166,7 +167,8 @@
focus_type = #{focusType},
biz_name = #{bizName},
pbiz_name = #{pbizName},
ftime = #{ftime}
ftime = #{ftime},
ubranch_id = #{ubranchId}
</sql>
<sql id="someFieldSet">
<if test="username != null and username != ''"> username = #{username}, </if>
@ -174,6 +176,7 @@
<if test="bizName != null and bizName != ''"> biz_name = #{bizName}, </if>
<if test="pbizName != null and pbizName != ''"> pbiz_name = #{pbizName}, </if>
<if test="ftime != null"> ftime = #{ftime}, </if>
<if test="ubranchId != null and ubranchId != ''"> ubranch_id = #{ubranchId}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -181,6 +184,7 @@
focus_type = #{item.focusType},
biz_name = #{item.bizName},
pbiz_name = #{item.pbizName},
ftime = #{item.ftime}
ftime = #{item.ftime},
ubranch_id = #{item.ubranchId}
</sql>
</mapper>
Loading…
Cancel
Save