|
@@ -6,6 +6,9 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.operate.model.OperateFlowData" id="operateFlowDataResult">
|
|
|
<id column="id" property="id" />
|
|
|
+ <result column="userId" property="userId" />
|
|
|
+ <result column="userName" property="userName" />
|
|
|
+ <result column="userPortrait" property="userPortrait" />
|
|
|
<result column="projectId" property="projectId" />
|
|
|
<result column="projectItemId" property="projectItemId" />
|
|
|
<result column="projectItemTargetId" property="projectItemTargetId" />
|
|
@@ -24,8 +27,13 @@
|
|
|
<result column="type" property="type" />
|
|
|
</resultMap>
|
|
|
|
|
|
+ <sql id="query">
|
|
|
+ SELECT a.*, b.name as userName, b.portrait as userPortrait FROM operate_flow_data a left join mgr_user b on a.userId = b.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
<select id="get" resultMap="operateFlowDataResult">
|
|
|
- SELECT * FROM operate_flow_data where id = #{id}
|
|
|
+ <include refid="query"/>
|
|
|
+ where a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="census" resultMap="operateFlowDataResult">
|
|
@@ -33,43 +41,43 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getListLimit" resultMap="operateFlowDataResult">
|
|
|
- SELECT * FROM operate_flow_data
|
|
|
+ <include refid="query"/>
|
|
|
<where>
|
|
|
<if test="ofd.id != 0">
|
|
|
- and id = #{ofd.id}
|
|
|
+ and a.id = #{ofd.id}
|
|
|
</if>
|
|
|
<if test="ofd.projectId != 0">
|
|
|
- and projectId = #{ofd.projectId}
|
|
|
+ and a.projectId = #{ofd.projectId}
|
|
|
</if>
|
|
|
<if test="ofd.projectItemId != 0">
|
|
|
- and projectItemId = #{ofd.projectItemId}
|
|
|
+ and a.projectItemId = #{ofd.projectItemId}
|
|
|
</if>
|
|
|
<if test="ofd.projectItemTargetId != 0">
|
|
|
- and projectItemTargetId = #{ofd.projectItemTargetId}
|
|
|
+ and a.projectItemTargetId = #{ofd.projectItemTargetId}
|
|
|
</if>
|
|
|
<if test="ofd.projectItemTargetRoomId != 0">
|
|
|
- and projectItemTargetRoomId = #{ofd.projectItemTargetRoomId}
|
|
|
+ and a.projectItemTargetRoomId = #{ofd.projectItemTargetRoomId}
|
|
|
</if>
|
|
|
<if test="ofd.deviceId != 0">
|
|
|
- and deviceId = #{ofd.deviceId}
|
|
|
+ and a.deviceId = #{ofd.deviceId}
|
|
|
</if>
|
|
|
<if test="ofd.projectFlowId != 0">
|
|
|
- and projectFlowId = #{ofd.projectFlowId}
|
|
|
+ and a.projectFlowId = #{ofd.projectFlowId}
|
|
|
</if>
|
|
|
<if test="ofd.state != null">
|
|
|
- and state = #{ofd.state}
|
|
|
+ and a.state = #{ofd.state}
|
|
|
</if>
|
|
|
<if test="ofd.createdByUserId != 0">
|
|
|
- and createdByUserId = #{ofd.createdByUserId}
|
|
|
+ and a.createdByUserId = #{ofd.createdByUserId}
|
|
|
</if>
|
|
|
<if test="ofd.flowType != null">
|
|
|
- and flowType = #{ofd.flowType}
|
|
|
+ and a.flowType = #{ofd.flowType}
|
|
|
</if>
|
|
|
<if test="ofd.type != null">
|
|
|
- and type = #{ofd.type}
|
|
|
+ and a.type = #{ofd.type}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by date desc
|
|
|
+ order by a.date desc
|
|
|
limit #{currIndex} , #{pageSize}
|
|
|
</select>
|
|
|
|
|
@@ -115,11 +123,11 @@
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
INSERT INTO operate_flow_data(
|
|
|
- projectId, projectItemId,
|
|
|
+ userId,projectId, projectItemId,
|
|
|
projectItemTargetId, projectItemTargetRoomId,
|
|
|
deviceId, date, projectFlowId, flowUserList, state, flowData, createdByUserId, document, receiver, attachment, flowType, type)
|
|
|
VALUES
|
|
|
- (#{projectId}, #{projectItemId},
|
|
|
+ (#{userId}, #{projectId}, #{projectItemId},
|
|
|
#{projectItemTargetId}, #{projectItemTargetRoomId},
|
|
|
#{deviceId}, now(), #{projectFlowId}, #{flowUserList}, #{state}, #{flowData}, #{createdByUserId}, #{document}, #{receiver}, #{attachment}, #{flowType}, #{type})
|
|
|
</insert>
|
|
@@ -131,6 +139,7 @@
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.operate.model.OperateFlowData">
|
|
|
UPDATE operate_flow_data
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="userId!=0">userId=#{userId},</if>
|
|
|
<if test="projectId!=0">projectId=#{projectId},</if>
|
|
|
<if test="projectItemId!=0">projectItemId=#{projectItemId},</if>
|
|
|
<if test="projectItemTargetId!=0">projectItemTargetId=#{projectItemTargetId},</if>
|