|
|
@@ -6,11 +6,11 @@
|
|
|
|
|
|
<sql id="selectFmsBlockVo">
|
|
|
select blockId, landId, blockName, blockType, blockManager, blockManagername, blockArea, blockAreaplant,blockSeq,
|
|
|
- blockLngrange, blockColor, blockRemark, blockIcon, tid from FmsBlock
|
|
|
+ blockLngrange, blockColor, blockRemark, blockIcon, tid, blockIstransfer, blockTransferinfo, blockOwnerinfo from FmsBlock
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectFmsBlockHasResVo">
|
|
|
- select b.blockId, b.landId, b.blockName, b.blockType, b.blockManager, b.blockManagername, b.blockArea, b.blockSeq, b.blockAreaplant, b.blockLngrange, b.blockColor, b.blockRemark, b.blockIcon,
|
|
|
+ select b.blockId, b.landId, b.blockName, b.blockType, b.blockManager, b.blockManagername, b.blockArea, b.blockSeq, b.blockAreaplant, b.blockLngrange, b.blockColor, b.blockRemark, b.blockIcon,, b.blockIstransfer, b.blockTransferinfo, b.blockOwnerinfo
|
|
|
(select GROUP_CONCAT(resUrl) from SysRes r where r.resBusId = b.blockId) blockPreview,
|
|
|
(select GROUP_CONCAT(resId) from SysRes r where r.resBusId = b.blockId) resIds,
|
|
|
b.tid
|
|
|
@@ -20,6 +20,7 @@
|
|
|
<sql id="selectFmsBlockHasResVo2">
|
|
|
select b.blockId, b.landId, b.blockName, b.blockType, b.blockManager, b.blockManagername, b.blockArea,
|
|
|
b.blockSeq, b.tid, b.blockAreaplant, b.blockLngrange, b.blockColor, b.blockRemark, b.blockIcon, l.landName,
|
|
|
+ b.blockIstransfer, b.blockTransferinfo, b.blockOwnerinfo,
|
|
|
(select GROUP_CONCAT(c.cropName) from FmsCrop c
|
|
|
left join FmsPlan p on p.cropId = c.cropId
|
|
|
where p.blockId = b.blockId) cropName,
|
|
|
@@ -36,7 +37,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <select id="selectFmsBlockList" parameterType="FmsBlock" resultType="FmsBlock">
|
|
|
+ <select id="selectFmsBlockList" parameterType="FmsBlock" resultType="com.yunfeiyun.agmp.fms.domain.FmsBlock">
|
|
|
<include refid="selectFmsBlockHasResVo"/>
|
|
|
<where>
|
|
|
b.tid = #{tid}
|
|
|
@@ -61,7 +62,7 @@
|
|
|
order by b.blockSeq
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectFmsBlockByBlockId" parameterType="String" resultType="FmsBlock">
|
|
|
+ <select id="selectFmsBlockByBlockId" parameterType="String" resultType="com.yunfeiyun.agmp.fms.domain.FmsBlock">
|
|
|
<include refid="selectFmsBlockHasResVo"/>
|
|
|
<where>
|
|
|
blockId = #{blockId}
|
|
|
@@ -69,9 +70,10 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectFmsBlockInfoByBlockId" parameterType="String" resultType="FmsBlockResVo">
|
|
|
+ <select id="selectFmsBlockInfoByBlockId" parameterType="String" resultType="com.yunfeiyun.agmp.fms.domain.resvo.FmsBlockResVo">
|
|
|
SELECT b.blockId, b.landId, b.blockName, b.blockType, b.blockManager, b.blockArea,
|
|
|
b.blockSeq, b.blockAreaplant, b.blockLngrange, b.blockColor, b.blockRemark, b.blockIcon,
|
|
|
+ b.blockIstransfer, b.blockTransferinfo, b.blockOwnerinfo
|
|
|
b.tid, l.landName,
|
|
|
u.userName as blockManagername, (select GROUP_CONCAT(resUrl) from SysRes r where r.resBusId = b.blockId) blockPreview
|
|
|
from FmsBlock b
|
|
|
@@ -91,29 +93,8 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectCountByPlanStatus" parameterType="SelectCountByPlanStatusReqVo" resultType="Integer">
|
|
|
- SELECT count(1) FROM
|
|
|
- (SELECT b.blockId,(SELECT count(1) FROM FmsPlan p
|
|
|
- <where>
|
|
|
- p.blockId = b.blockId
|
|
|
- and p.tid = #{tid}
|
|
|
- <if test="planStatus != null and planStatus != ''">
|
|
|
- and p.planStatus in
|
|
|
- <foreach collection="planStatus.split(',')" item="item" index="index" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) count FROM FmsBlock b
|
|
|
- <where>
|
|
|
- b.tid = #{tid}
|
|
|
- <if test="landId != null and landId != ''">and b.landId = #{landId}</if>
|
|
|
- </where>
|
|
|
- ) tb
|
|
|
- WHERE tb.count > 0
|
|
|
- </select>
|
|
|
|
|
|
- <select id="selectSumAreaByLandId" parameterType="FmsLand" resultType="BigDecimal">
|
|
|
+ <select id="selectSumAreaByLandId" parameterType="FmsLand" resultType="java.math.BigDecimal">
|
|
|
select sum(blockArea) from FmsBlock
|
|
|
<where>
|
|
|
tid = #{tid}
|
|
|
@@ -127,7 +108,7 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectSumArea" parameterType="FmsBlockReqVo" resultType="BigDecimal">
|
|
|
+ <select id="selectSumArea" parameterType="FmsBlockReqVo" resultType="java.math.BigDecimal">
|
|
|
select sum(b.blockArea) from FmsBlock b LEFT JOIN FmsLand l ON b.landId = l.landId WHERE l.landId is not null
|
|
|
and b.tid = #{tid}
|
|
|
<if test="landId != null and landId != ''"> and l.landId = #{landId}</if>
|
|
|
@@ -140,7 +121,7 @@
|
|
|
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectFmsBlockHasPlan" parameterType="FmsBlockReqVo" resultType="FmsBlockResVo">
|
|
|
+ <select id="selectFmsBlockHasPlan" parameterType="FmsBlockReqVo" resultType="com.yunfeiyun.agmp.fms.domain.resvo.FmsBlockResVo">
|
|
|
select b.* , l.landName,
|
|
|
tb1.blockPreview,
|
|
|
tb1.resIds,
|
|
|
@@ -167,129 +148,7 @@
|
|
|
order by b.blockSeq
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertFmsBlock" parameterType="FmsBlock">
|
|
|
- insert into FmsBlock
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="blockId != null">blockId,</if>
|
|
|
- <if test="landId != null">landId,</if>
|
|
|
- <if test="blockName != null">blockName,</if>
|
|
|
- <if test="blockType != null">blockType,</if>
|
|
|
- <if test="blockManager != null">blockManager,</if>
|
|
|
- <if test="blockManagername != null">blockManagername,</if>
|
|
|
- <if test="blockArea != null">blockArea,</if>
|
|
|
- <if test="blockAreaplant != null">blockAreaplant,</if>
|
|
|
- <if test="blockLngrange != null">blockLngrange,</if>
|
|
|
- <if test="blockColor != null">blockColor,</if>
|
|
|
- <if test="blockRemark != null">blockRemark,</if>
|
|
|
- <if test="blockIcon != null">blockIcon,</if>
|
|
|
- <if test="blockSeq != null">blockSeq,</if>
|
|
|
- <if test="tid != null">tid,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="blockId != null">#{blockId},</if>
|
|
|
- <if test="landId != null">#{landId},</if>
|
|
|
- <if test="blockName != null">#{blockName},</if>
|
|
|
- <if test="blockType != null">#{blockType},</if>
|
|
|
- <if test="blockManager != null">#{blockManager},</if>
|
|
|
- <if test="blockManagername != null">#{blockManagername},</if>
|
|
|
- <if test="blockArea != null">#{blockArea},</if>
|
|
|
- <if test="blockAreaplant != null">#{blockAreaplant},</if>
|
|
|
- <if test="blockLngrange != null">#{blockLngrange},</if>
|
|
|
- <if test="blockColor != null">#{blockColor},</if>
|
|
|
- <if test="blockRemark != null">#{blockRemark},</if>
|
|
|
- <if test="blockIcon != null">#{blockIcon},</if>
|
|
|
- <if test="blockSeq != null">#{blockSeq},</if>
|
|
|
- <if test="tid != null">#{tid},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateFmsBlock" parameterType="FmsBlock">
|
|
|
- update FmsBlock
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="landId != null">landId = #{landId},</if>
|
|
|
- <if test="blockName != null">blockName = #{blockName},</if>
|
|
|
- <if test="blockType != null">blockType = #{blockType},</if>
|
|
|
- <if test="blockManager != null">blockManager = #{blockManager},</if>
|
|
|
- <if test="blockManagername != null">blockManagername = #{blockManagername},</if>
|
|
|
- <if test="blockArea != null">blockArea = #{blockArea},</if>
|
|
|
- <if test="blockAreaplant != null">blockAreaplant = #{blockAreaplant},</if>
|
|
|
- <if test="blockLngrange != null">blockLngrange = #{blockLngrange},</if>
|
|
|
- <if test="blockColor != null">blockColor = #{blockColor},</if>
|
|
|
- <if test="blockRemark != null">blockRemark = #{blockRemark},</if>
|
|
|
- <if test="blockSeq != null">blockSeq =#{blockSeq},</if>
|
|
|
- <if test="blockIcon != null">blockIcon = #{blockIcon},</if>
|
|
|
- <if test="tid != null">tid = #{tid},</if>
|
|
|
- </trim>
|
|
|
- <where>
|
|
|
- blockId = #{blockId}
|
|
|
- and tid = #{tid}
|
|
|
- </where>
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="updateFmsBlockBatch" parameterType="FmsBlock">
|
|
|
- <foreach collection="list" item="block" separator=";">
|
|
|
- update FmsBlock
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="block.landId != null">landId = #{block.landId},</if>
|
|
|
- <if test="block.blockName != null">blockName = #{block.blockName},</if>
|
|
|
- <if test="block.blockType != null">blockType = #{block.blockType},</if>
|
|
|
- <if test="block.blockManager != null">blockManager = #{block.blockManager},</if>
|
|
|
- <if test="block.blockManagername != null">blockManagername = #{block.blockManagername},</if>
|
|
|
- <if test="block.blockArea != null">blockArea = #{block.blockArea},</if>
|
|
|
- <if test="block.blockAreaplant != null">blockAreaplant = #{block.blockAreaplant},</if>
|
|
|
- <if test="block.blockLngrange != null">blockLngrange = #{block.blockLngrange},</if>
|
|
|
- <if test="block.blockColor != null">blockColor = #{block.blockColor},</if>
|
|
|
- <if test="block.blockRemark != null">blockRemark = #{block.blockRemark},</if>
|
|
|
- <if test="block.blockSeq != null">blockSeq =#{block.blockSeq},</if>
|
|
|
- <if test="block.blockIcon != null">blockIcon = #{block.blockIcon},</if>
|
|
|
- <if test="block.tid != null">tid = #{block.tid},</if>
|
|
|
- </trim>
|
|
|
- <where>
|
|
|
- blockId = #{block.blockId}
|
|
|
- and tid = #{block.tid}
|
|
|
- </where>
|
|
|
- </foreach>
|
|
|
- </update>
|
|
|
- <update id="updateManagerByBlockIds">
|
|
|
- update FmsBlock set blockManager = #{manager},blockManagername = #{managerName}
|
|
|
- <where>
|
|
|
- blockId in
|
|
|
- <foreach collection="blockIds" index="index" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- and tid = #{tid}
|
|
|
- </where>
|
|
|
- </update>
|
|
|
- <update id="clearManagerByManagerId">
|
|
|
- update FmsBlock set blockManager = null
|
|
|
- <where>
|
|
|
- blockManager = #{manager}
|
|
|
- and tid = #{tid}
|
|
|
- </where>
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteFmsBlockByBlockId" parameterType="String">
|
|
|
- delete from FmsBlock
|
|
|
- <where>
|
|
|
- blockId = #{blockId}
|
|
|
- and tid = #{tid}
|
|
|
- </where>
|
|
|
-
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteFmsBlockByBlockIds" parameterType="String">
|
|
|
- delete from FmsBlock
|
|
|
- <where>
|
|
|
- blockId in
|
|
|
- <foreach item="blockId" collection="array" open="(" separator="," close=")">
|
|
|
- #{blockId}
|
|
|
- </foreach>
|
|
|
- and tid = #{tid}
|
|
|
- </where>
|
|
|
-
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="selectFmsLandByBlockIds" parameterType="String" resultType="FmsLand">
|
|
|
+ <select id="selectFmsLandByBlockIds" parameterType="String" resultType="com.yunfeiyun.agmp.fms.domain.FmsLand">
|
|
|
select l.* from FmsBlock b LEFT JOIN FmsLand l ON b.landId = l.landId
|
|
|
<where>
|
|
|
b.blockId in
|
|
|
@@ -310,55 +169,6 @@
|
|
|
</trim>
|
|
|
AS validDataNum
|
|
|
</select>
|
|
|
- <select id="selectBlockManagerAndLandManager"
|
|
|
- resultType="SysUser">
|
|
|
- select u.userId, u.deptId, u.userLoginname, u.userName, u.userEmail, u.userMobile, u.userLoginpwd, u.userSex, u.userLockstatus, u.userDelstatus, u.userLastloginip, u.userLastlogindate, u.userCreator, u.userCreateddate, u.userRemark,u.userRegion,
|
|
|
- GROUP_CONCAT(r.roleId) as roleId,
|
|
|
- GROUP_CONCAT(r.roleName) as roleName,
|
|
|
- GROUP_CONCAT(r.roleKey) as roleKey,
|
|
|
- res.resUrl as userAvatar
|
|
|
- from SysUser u
|
|
|
- left join SysUserrole ur on u.userId = ur.userId
|
|
|
- left join SysRole r on r.roleId = ur.roleId
|
|
|
- left join SysRes res on res.resBusId = u.userId
|
|
|
- <where>
|
|
|
- r.roleKey in ('land_admin','block_admin') and u.tid = #{tid}
|
|
|
- <if test="roleName != null and roleName != ''">and r.roleName like CONCAT('%',#{roleName},'%')</if>
|
|
|
- <if test="userName != null and userName != ''">and u.userName like CONCAT('%',#{userName},'%')</if>
|
|
|
- <if test="userLoginname != null and userLoginname !=''">and u.userLoginname = #{userLoginname}</if>
|
|
|
- <if test="userMobile != null and userMobile !=''">and u.userMobile = #{userMobile}</if>
|
|
|
- </where>
|
|
|
- GROUP BY u.userId
|
|
|
- </select>
|
|
|
- <select id="selectFmsBlockBaseDataList" resultType="com.yunfeiyun.agmp.fms.domain.FmsBlock">
|
|
|
- <include refid="selectFmsBlockVo"/>
|
|
|
- <where>
|
|
|
- and tid = #{tid}
|
|
|
- <if test="landId != null and landId != ''"> and landId = #{landId}</if>
|
|
|
- <if test="blockName != null and blockName != ''"> and blockName like concat('%', #{blockName}, '%')</if>
|
|
|
- <if test="blockNameEq != null and blockNameEq != ''"> and blockName = #{blockNameEq}</if>
|
|
|
- <if test="blockType != null and blockType != ''"> and blockType = #{blockType}</if>
|
|
|
- <if test="blockManager != null and blockManager != ''"> and blockManager = #{blockManager}</if>
|
|
|
- <if test="blockManagername != null and blockManagername != ''"> and blockManagername like concat('%', #{blockManagername}, '%')</if>
|
|
|
- <if test="blockArea != null "> and blockArea = #{blockArea}</if>
|
|
|
- <if test="blockAreaplant != null "> and blockAreaplant = #{blockAreaplant}</if>
|
|
|
- <if test="blockLngrange != null and blockLngrange != ''"> and blockLngrange = #{blockLngrange}</if>
|
|
|
- <if test="blockColor != null and blockColor != ''"> and blockColor = #{blockColor}</if>
|
|
|
- <if test="blockRemark != null and blockRemark != ''"> and blockRemark = #{blockRemark}</if>
|
|
|
- <if test="dataFilter == true and blockIds !=null and blockIds.size()>0">
|
|
|
- and blockId in
|
|
|
- <foreach collection="blockIds" item="blockId" index="index" open="(" close=")" separator=",">
|
|
|
- #{blockId}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="landIds != null and landIds.size()!=0">
|
|
|
- and landId in
|
|
|
- <foreach collection="landIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
<select id="selectFmsBlockListByLandManager" resultType="com.yunfeiyun.agmp.fms.domain.FmsBlock">
|
|
|
select * from FmsBlock
|
|
|
where landId in (
|
|
|
@@ -410,5 +220,27 @@
|
|
|
delete from FmsBlockUser where userId = #{userId} and tid = #{tid}
|
|
|
</delete>
|
|
|
|
|
|
+ <update id="updateFmsBlock" parameterType="FmsBlock">
|
|
|
+ update FmsBlock
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="landId != null">landId = #{landId},</if>
|
|
|
+ <if test="blockName != null">blockName = #{blockName},</if>
|
|
|
+ <if test="blockType != null">blockType = #{blockType},</if>
|
|
|
+ <if test="blockManager != null">blockManager = #{blockManager},</if>
|
|
|
+ <if test="blockManagername != null">blockManagername = #{blockManagername},</if>
|
|
|
+ <if test="blockArea != null">blockArea = #{blockArea},</if>
|
|
|
+ <if test="blockAreaplant != null">blockAreaplant = #{blockAreaplant},</if>
|
|
|
+ <if test="blockLngrange != null">blockLngrange = #{blockLngrange},</if>
|
|
|
+ <if test="blockColor != null">blockColor = #{blockColor},</if>
|
|
|
+ <if test="blockRemark != null">blockRemark = #{blockRemark},</if>
|
|
|
+ <if test="blockSeq != null">blockSeq =#{blockSeq},</if>
|
|
|
+ <if test="blockIcon != null">blockIcon = #{blockIcon},</if>
|
|
|
+ <if test="tid != null">tid = #{tid},</if>
|
|
|
+ </trim>
|
|
|
+ <where>
|
|
|
+ blockId = #{blockId}
|
|
|
+ and tid = #{tid}
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
|
|
|
</mapper>
|