| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yunfeiyun.agmp.iotm.web.mapper.IotPestMapper">
- <resultMap type="IotPest" id="IotPestResult">
- <result property="id" column="id"/>
- <result property="pestBid" column="pestBid"/>
- <result property="cId" column="cId"/>
- <result property="pestName" column="pestName"/>
- <result property="pestId" column="pestId"/>
- <result property="pestRemark" column="pestRemark"/>
- <result property="pestCreator" column="pestCreator"/>
- <result property="pestModifier" column="pestModifier"/>
- <result property="pestModifieddate" column="pestModifieddate"/>
- <result property="pestCreatedDate" column="pestCreatedDate"/>
- <result property="pestDelstatus" column="pestDelstatus"/>
- <result property="pestInsertType" column="pestInsertType"/>
- </resultMap>
- <sql id="selectIotPestVo">
- select id, pestBid, cId, pestName, pestId, pestRemark, pestCreator, pestModifier, pestModifieddate, pestCreatedDate, pestDelstatus, pestInsertType from IotPest
- </sql>
- <select id="selectIotPestList" parameterType="IotPest" resultMap="IotPestResult">
- <include refid="selectIotPestVo"/>
- <where>
- pestDelstatus = 0
- <if test="pestBid != null and pestBid != ''">and pestBid = #{pestBid}</if>
- <if test="cId != null and cId != ''">and cId = #{cId}</if>
- <if test="pestName != null and pestName != ''">and pestName like concat('%', #{pestName}, '%')</if>
- <if test="pestId != null and pestId != ''">and pestId = #{pestId}</if>
- <if test="pestInsertType != null and pestInsertType != ''">and pestInsertType = #{pestInsertType}</if>
- <if test="pestRemark != null and pestRemark != ''">and pestRemark like concat('%', #{pestRemark}, '%')</if>
- </where>
- </select>
- <select id="selectIotPestByPestBid" parameterType="String" resultMap="IotPestResult">
- <include refid="selectIotPestVo"/>
- where pestBid = #{pestBid}
- </select>
- <select id="selectIotPestByPestId" parameterType="String" resultMap="IotPestResult">
- <include refid="selectIotPestVo"/>
- where pestId = #{pestId}
- </select>
- <select id="selectIotPestListBatchByBid" parameterType="java.util.List" resultMap="IotPestResult">
- <include refid="selectIotPestVo"/>
- where pestDelstatus = '0' and pestBid in
- <foreach item="pestBid" collection="list" open="(" separator="," close=")">
- #{pestBid}
- </foreach>
- </select>
- <select id="selectIotPestDetailByPestBid"
- resultType="com.yunfeiyun.agmp.iot.common.domain.resvo.IoPestResVo">
- SELECT b.calarmCloudresurl pic , b.calamRemark ,CONCAT(b.calamFamilies,b.calamOrders) course ,b.calarmId from (
- SELECT * from IotPest where pestBid=#{pestBid}
- ) a LEFT JOIN FmsCalarm b on calarmName = a.pestName limit 0,1
- </select>
- <select id="selectIotPestCropsByCalarmId" resultType="java.lang.String">
- SELECT group_concat(cropName) crops from FmsCropcalarm where calarmId=#{calarmId} GROUP BY calarmId
- </select>
- <select id="selectIotPestByPestName" resultType="com.yunfeiyun.agmp.iot.common.domain.IotPest">
- <include refid="selectIotPestVo"/>
- <where>
- pestDelstatus = 0
- <if test="pestBid != null and pestBid != ''">and pestBid = #{pestBid}</if>
- <if test="cId != null and cId != ''">and cId = #{cId}</if>
- <if test="pestName != null and pestName != ''">and pestName like concat('%', #{pestName}, '%')</if>
- <if test="pestId != null and pestId != ''">and pestId = #{pestId}</if>
- <if test="pestRemark != null and pestRemark != ''">and pestRemark like concat('%', #{pestRemark}, '%')</if>
- </where>
- limit 1
- </select>
- <insert id="insertIotPest" parameterType="IotPest" useGeneratedKeys="true" keyProperty="id">
- insert into IotPest
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="pestBid != null and pestBid != ''">pestBid,</if>
- <if test="cId != null">cId,</if>
- <if test="pestName != null">pestName,</if>
- <if test="pestId != null">pestId,</if>
- <if test="pestRemark != null">pestRemark,</if>
- <if test="pestCreator != null">pestCreator,</if>
- <if test="pestModifier != null">pestModifier,</if>
- <if test="pestModifieddate != null">pestModifieddate,</if>
- <if test="pestCreatedDate != null">pestCreatedDate,</if>
- <if test="pestDelstatus != null">pestDelstatus,</if>
- <if test="pestInsertType != null">pestInsertType,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="pestBid != null and pestBid != ''">#{pestBid},</if>
- <if test="cId != null">#{cId},</if>
- <if test="pestName != null">#{pestName},</if>
- <if test="pestId != null">#{pestId},</if>
- <if test="pestRemark != null">#{pestRemark},</if>
- <if test="pestCreator != null">#{pestCreator},</if>
- <if test="pestModifier != null">#{pestModifier},</if>
- <if test="pestModifieddate != null">#{pestModifieddate},</if>
- <if test="pestCreatedDate != null">#{pestCreatedDate},</if>
- <if test="pestDelstatus != null">#{pestDelstatus},</if>
- <if test="pestInsertType != null">#{pestInsertType},</if>
- </trim>
- </insert>
- <update id="updateIotPest" parameterType="IotPest">
- update IotPest
- <trim prefix="SET" suffixOverrides=",">
- <if test="pestBid != null and pestBid != ''">pestBid = #{pestBid},</if>
- <if test="cId != null">cId = #{cId},</if>
- <if test="pestName != null">pestName = #{pestName},</if>
- <if test="pestId != null">pestId = #{pestId},</if>
- <if test="pestRemark != null">pestRemark = #{pestRemark},</if>
- <if test="pestCreator != null">pestCreator = #{pestCreator},</if>
- <if test="pestModifier != null">pestModifier = #{pestModifier},</if>
- <if test="pestModifieddate != null">pestModifieddate = #{pestModifieddate},</if>
- <if test="pestCreatedDate != null">pestCreatedDate = #{pestCreatedDate},</if>
- <if test="pestDelstatus != null">pestDelstatus = #{pestDelstatus},</if>
- <if test="pestInsertType != null">pestInsertType = #{pestInsertType},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteIotPestById" parameterType="Long">
- delete from IotPest where id = #{id}
- </delete>
- <delete id="deleteIotPestByIds" parameterType="String">
- delete from IotPest where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|