Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
ae552cc009
  1. 21
      xm-core/src/main/java/com/xm/core/entity/XmProductProjectLink.java
  2. 63
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml

21
xm-core/src/main/java/com/xm/core/entity/XmProductProjectLink.java

@ -7,9 +7,9 @@ import java.util.Date;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmProductProjectLink所有属性名: <br> * 实体 XmProductProjectLink所有属性名: <br>
* projectId,productId,ctime,cuserid,cusername,linkStatus;<br>
* XM.xm_product_project_link 产品与项目的关联关系表一般由产品经理挂接项目到产品上的所有字段名: <br>
* project_id,product_id,ctime,cuserid,cusername,link_status;<br>
* projectId,productId,ctime,cuserid,cusername,linkStatus,seq;<br>
* xm_product_project_link 产品与项目的关联关系表一般由产品经理挂接项目到产品上的所有字段名: <br>
* project_id,product_id,ctime,cuserid,cusername,link_status,seq;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* project_id,product_id;<br> * project_id,product_id;<br>
*/ */
@ -37,6 +37,9 @@ public class XmProductProjectLink implements java.io.Serializable {
@ApiModelProperty(notes="关联状态1关联0取消关联",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="关联状态1关联0取消关联",allowEmptyValue=true,example="",allowableValues="")
String linkStatus; String linkStatus;
@ApiModelProperty(notes="显示顺序0-999,从小到大排序",allowEmptyValue=true,example="",allowableValues="")
Integer seq;
/**项目表中的主键,产品表中的主键**/ /**项目表中的主键,产品表中的主键**/
public XmProductProjectLink(String projectId,String productId) { public XmProductProjectLink(String projectId,String productId) {
this.projectId = projectId; this.projectId = projectId;
@ -83,6 +86,12 @@ public class XmProductProjectLink implements java.io.Serializable {
public void setLinkStatus(String linkStatus) { public void setLinkStatus(String linkStatus) {
this.linkStatus = linkStatus; this.linkStatus = linkStatus;
} }
/**
* 显示顺序0-999,从小到大排序
**/
public void setSeq(Integer seq) {
this.seq = seq;
}
/** /**
* 项目表中的主键 * 项目表中的主键
@ -120,5 +129,11 @@ public class XmProductProjectLink implements java.io.Serializable {
public String getLinkStatus() { public String getLinkStatus() {
return this.linkStatus; return this.linkStatus;
} }
/**
* 显示顺序0-999,从小到大排序
**/
public Integer getSeq() {
return this.seq;
}
} }

63
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml

@ -3,9 +3,16 @@
<mapper namespace="com.xm.core.entity.XmProductProjectLink"> <mapper namespace="com.xm.core.entity.XmProductProjectLink">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" pkList != null"> and (res.project_id, res.product_id) in
<foreach collection="pkList" item="item" index="index" open="(" separator="," close=")" >
( #{item.projectId}, #{item.productId})
</foreach>
</if>
<if test="key != null and key !='' "> </if>
</sql>
<select id="selectListByIterationId" parameterType="String" resultType="com.xm.core.entity.XmProductProjectLink"> <select id="selectListByIterationId" parameterType="String" resultType="com.xm.core.entity.XmProductProjectLink">
select * from xm_product_project_link res select * from xm_product_project_link res
where exists (select 1 from xm_iteration ipl where ipl.id=#{iterationId} and ipl.product_id=res.product_id) where exists (select 1 from xm_iteration ipl where ipl.id=#{iterationId} and ipl.product_id=res.product_id)
@ -20,14 +27,8 @@
select res.*,prd.product_name,prj.name from xm_product_project_link res select res.*,prd.product_name,prj.name from xm_product_project_link res
inner join xm_product prd on prd.id=res.product_id inner join xm_project prj on prj.id=res.project_id inner join xm_product prd on prd.id=res.product_id inner join xm_project prj on prj.id=res.project_id
<where> <where>
<if test="ids != null"> and
project_id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<include refid="whereForMap"/>
<include refid="where"/> <include refid="where"/>
<if test="key != null and key !='' "> </if>
</where> </where>
</select> </select>
@ -46,7 +47,13 @@
res.project_id = #{projectId} res.project_id = #{projectId}
and res.product_id = #{productId} and res.product_id = #{productId}
</select> </select>
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmProductProjectLink">
select * from xm_product_project_link res
where (res.project_id, res.product_id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.projectId}, #{item.productId})
</foreach>
</select>
<!-- 通过主键查询获取数据对象 返回map--> <!-- 通过主键查询获取数据对象 返回map-->
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> <select id="selectOneMap" parameterType="HashMap" resultType="HashMap">
select * from xm_product_project_link res select * from xm_product_project_link res
@ -56,7 +63,7 @@
</select> </select>
<!-- 获取数据条目 返回long --> <!-- 获取数据条目 返回long -->
<select id="countByWhere" parameterType="com.xm.core.entity.XmProductProjectLink" resultType="long"> <select id="countByWhere" parameterType="com.xm.core.entity.XmProductProjectLink" resultType="long">
select count(1) from xm_product_project_link res
select count(*) from xm_product_project_link res
<where> <where>
<include refid="where"/> <include refid="where"/>
</where> </where>
@ -66,15 +73,15 @@
insert into xm_product_project_link( insert into xm_product_project_link(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{projectId},#{productId},#{ctime},#{cuserid},#{cusername},#{linkStatus}
#{projectId},#{productId},#{ctime},#{cuserid},#{cusername},#{linkStatus},#{seq}
) )
</insert> </insert>
<!-- 按条件删除若干条记录--> <!-- 按条件删除若干条记录-->
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmProductProjectLink"> <delete id="deleteByWhere" parameterType="com.xm.core.entity.XmProductProjectLink">
delete from xm_product_project_link
delete from xm_product_project_link res
<where> <where>
1=2
<include refid="where"/>
</where> </where>
</delete> </delete>
@ -116,22 +123,32 @@
where project_id = #{item.projectId} and product_id = #{item.productId} where project_id = #{item.projectId} and product_id = #{item.productId}
</foreach> </foreach>
</update> </update>
<!-- 批量修改某几个字段 -->
<delete id="editSomeFields" parameterType="HashMap">
update xm_product_project_link
<set>
<include refid="someFieldSet"/>
</set>
where (project_id, product_id) in
<foreach collection="pkList" item="item" index="index" open="(" separator="," close=")" >
( #{item.projectId}, #{item.productId})
</foreach>
</delete>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_product_project_link delete from xm_product_project_link
where where
(project_id, product_id)
in
(project_id, product_id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > <foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.projectId}, #{item.productId}
)
( #{item.projectId}, #{item.productId} )
</foreach> </foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
project_id,product_id,ctime,cuserid,cusername,link_status
project_id,product_id,ctime,cuserid,cusername,link_status,seq
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -142,25 +159,29 @@
<if test="cuserid != null and cuserid != ''"> and res.cuserid = #{cuserid} </if> <if test="cuserid != null and cuserid != ''"> and res.cuserid = #{cuserid} </if>
<if test="cusername != null and cusername != ''"> and res.cusername = #{cusername} </if> <if test="cusername != null and cusername != ''"> and res.cusername = #{cusername} </if>
<if test="linkStatus != null and linkStatus != ''"> and res.link_status = #{linkStatus} </if> <if test="linkStatus != null and linkStatus != ''"> and res.link_status = #{linkStatus} </if>
<if test="seq != null and seq != ''"> and res.seq = #{seq} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
ctime = #{ctime}, ctime = #{ctime},
cuserid = #{cuserid}, cuserid = #{cuserid},
cusername = #{cusername}, cusername = #{cusername},
link_status = #{linkStatus}
link_status = #{linkStatus},
seq = #{seq}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="ctime != null"> ctime = #{ctime}, </if> <if test="ctime != null"> ctime = #{ctime}, </if>
<if test="cuserid != null and cuserid != ''"> cuserid = #{cuserid}, </if> <if test="cuserid != null and cuserid != ''"> cuserid = #{cuserid}, </if>
<if test="cusername != null and cusername != ''"> cusername = #{cusername}, </if> <if test="cusername != null and cusername != ''"> cusername = #{cusername}, </if>
<if test="linkStatus != null and linkStatus != ''"> link_status = #{linkStatus}, </if> <if test="linkStatus != null and linkStatus != ''"> link_status = #{linkStatus}, </if>
<if test="seq != null and seq != ''"> seq = #{seq}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
ctime = #{item.ctime}, ctime = #{item.ctime},
cuserid = #{item.cuserid}, cuserid = #{item.cuserid},
cusername = #{item.cusername}, cusername = #{item.cusername},
link_status = #{item.linkStatus}
link_status = #{item.linkStatus},
seq = #{item.seq}
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save