| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.yt.zhylplat.modulePest.specialRecord.mapper.TPestcAphidRecordMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.yt.zhylplat.modulePest.specialRecord.entity.TPestcAphidRecord">
- <id column="id" property="id"/>
- <result column="survey_user_id" property="surveyUserId"/>
- <result column="survey_address" property="surveyAddress"/>
- <result column="survey_date" property="surveyDate"/>
- <result column="dry_hatch_num" property="dryHatchNum"/>
- <result column="dry_hatch_amount" property="dryHatchAmount"/>
- <result column="remark" property="remark"/>
- <result column="create_user_id" property="createUserId"/>
- <result column="create_date" property="createDate"/>
- <result column="update_user_id" property="updateUserId"/>
- <result column="update_date" property="updateDate"/>
- <result column="del_flg" property="delFlg"/>
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, survey_user_id, survey_address, survey_date, dry_hatch_num, dry_hatch_amount, remark, create_user_id, create_date, update_user_id, update_date, del_flg
- </sql>
- <select id="pageList" resultMap="BaseResultMap">
- select
- uuid,
- survey_date
- from T_Pestc_Aphid_Record
- where del_flg = '0'
- <if test="tPestcAphidRecord.surveyDate !=null">
- and survey_date = #{tPestcAphidRecord.surveyDate}
- </if>
- <if test="tPestcAphidRecord.surveyAddress !=null and tPestcAphidRecord.surveyAddress != '' ">
- and survey_address like concat('%',#{tPestcAphidRecord.surveyAddress},'%')
- </if>
- <if test="tPestcAphidRecord.surveyUserId !=null and tPestcAphidRecord.surveyUserId != '' ">
- and survey_user_id = #{tPestcAphidRecord.surveyUserId}
- </if>
- group by uuid,survey_date
- order by survey_date desc
- </select>
- <select id="selectAphidRecordList"
- resultType="com.yt.zhylplat.modulePest.specialRecord.entity.TPestcAphidRecord">
- select
- DATE_FORMAT( survey_date, '%Y-%m-%d' ) as surveyDateStr,
- avg(if(dry_hatch_amount is null, 0, dry_hatch_amount)) as dry_hatch_amount
- from
- T_Pestc_Aphid_Record
- where
- del_flg = 0
- <if test="surveyUserId != null">
- and survey_user_id = #{surveyUserId}
- </if>
- group by
- survey_date
- order by
- survey_date
- </select>
- </mapper>
|