暂时提交
parent
cb5c4615aa
commit
e07f0c1ebd
|
|
@ -49,6 +49,7 @@ public class SysAgriInfo extends BaseEntity
|
|||
|
||||
/** 关联用户ID */
|
||||
@Excel(name = "关联用户ID")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
/** 告警开关(0-关闭,1-开启) */
|
||||
|
|
@ -118,4 +119,12 @@ public class SysAgriInfo extends BaseEntity
|
|||
|
||||
@TableField(exist = false)
|
||||
private String msg;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer status;
|
||||
|
||||
/** 关联用户ID */
|
||||
@TableField(exist = false)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inviteBy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ public class SysAgriInfoServiceImpl extends ServiceImpl<SysAgriInfoMapper, SysAg
|
|||
SysAgriInfo sysAgriInfo = new SysAgriInfo();
|
||||
if (!SecurityUtils.isAdmin()) {
|
||||
sysAgriInfo.setUserId(userId);
|
||||
sysAgriInfo.setStatus(1);
|
||||
}
|
||||
List<SysAgriInfo> agriInfos = baseMapper.findAgriByUser(sysAgriInfo);
|
||||
if (CollectionUtils.isEmpty(agriInfos)) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
agri.quilt_num,
|
||||
agri.film_num,
|
||||
agri.blind_num,
|
||||
user_agri.user_id
|
||||
user_agri.user_id,
|
||||
user_agri.invite_by
|
||||
FROM
|
||||
sys_agri_info agri
|
||||
LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.imei
|
||||
|
|
@ -173,14 +174,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 通用查询大棚列表 可查全部、可根据大棚用户查询 -->
|
||||
<select id="findAgriByUser" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
||||
<include refid="agriUserVo"/>
|
||||
<if test="userId == null"> and user_agri.user_id is null </if>
|
||||
<where>
|
||||
is_deleted = 0
|
||||
<if test="userId != null"> and user_agri.user_id = #{userId}</if>
|
||||
<if test="status != null"> and user_agri.status = #{status}</if>
|
||||
<if test="userId != null">
|
||||
and user_agri.user_id = #{userId}
|
||||
<if test="inviteBy != null">
|
||||
or user_agri.invite_by = #{inviteBy}
|
||||
</if>
|
||||
</if>
|
||||
<if test="imei != null and imei != ''"> and agri.imei = #{imei}</if>
|
||||
<if test="workMode != null and workMode != ''"> and agri.work_mode = #{workMode}</if>
|
||||
<if test="agriName != null and agriName != ''"> and agri.agri_name like concat('%', #{agriName}, '%')</if>
|
||||
|
|
@ -191,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 小程序首页数据 -->
|
||||
<select id="findAgriInfoByUser" parameterType="SysAgriInfo" resultType="com.agri.system.domain.vo.AgriInfoView">
|
||||
<include refid="agriInfoVo"/>
|
||||
<where>
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
`u`.status,
|
||||
`u`.del_flag
|
||||
</sql>
|
||||
<!-- 获取大棚对应用户 -->
|
||||
<select id="findAgriUser" parameterType="SysUserAgri" resultMap="SysUserAgriResult">
|
||||
<include refid="agriUserVo"/>
|
||||
FROM
|
||||
|
|
|
|||
Loading…
Reference in New Issue