|  |  |  | 
|---|
|  |  |  | stir_running4, inject_running, irr_running, alarm, manure_flow, manure_time, stir_time, | 
|---|
|  |  |  | stir_duration, inject_duration | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <sql id="Base_Column_List_with_alias"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | ${alias}.id, ${alias}.last_history_id, ${alias}.manure_id, ${alias}.dt, ${alias}.stir_running1, ${alias}.stir_running2, ${alias}.stir_running3, | 
|---|
|  |  |  | ${alias}.stir_running4, ${alias}.inject_running, ${alias}.irr_running, ${alias}.alarm, ${alias}.manure_flow, ${alias}.manure_time, ${alias}.stir_time, | 
|---|
|  |  |  | ${alias}.stir_duration, ${alias}.inject_duration | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据指定条件查询历史记录数量--> | 
|---|
|  |  |  | <!--根据指定条件查询记录数量--> | 
|---|
|  |  |  | <select id="selectCount" resultType="java.lang.Long"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | COUNT(*) AS recordCount | 
|---|
|  |  |  | 
|---|
|  |  |  | AND mtb.no = #{no} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "name != null and name !=''"> | 
|---|
|  |  |  | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') | 
|---|
|  |  |  | AND mtb.name LIKE CONCAT('%',#{name},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "timeStart != null and timeStop != null"> | 
|---|
|  |  |  | <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''"> | 
|---|
|  |  |  | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据指定条件查询历史记录--> | 
|---|
|  |  |  | <!--根据指定条件查询记录--> | 
|---|
|  |  |  | <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoManure"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | <include refid="Base_Column_List" />, | 
|---|
|  |  |  | <include refid="Base_Column_List_with_alias" > | 
|---|
|  |  |  | <property name="alias" value="ltb"/> | 
|---|
|  |  |  | </include>, | 
|---|
|  |  |  | mtb.`name` AS manureName | 
|---|
|  |  |  | FROM rm_manure_last ltb | 
|---|
|  |  |  | INNER JOIN pr_st_manure mtb ON mtb.id = ltb.manure_id | 
|---|
|  |  |  | 
|---|
|  |  |  | AND mtb.no = #{no} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "name != null and name !=''"> | 
|---|
|  |  |  | AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') | 
|---|
|  |  |  | AND mtb.name LIKE CONCAT('%',#{name},'%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test = "timeStart != null and timeStop != null"> | 
|---|
|  |  |  | <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''"> | 
|---|
|  |  |  | AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据指定条件获取记录--> | 
|---|
|  |  |  | <select id="selectSomeByManureId" resultType="com.dy.pipIrrGlobal.voRm.VoManure"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | <include refid="Base_Column_List" /> | 
|---|
|  |  |  | from rm_manure_last | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="manureId != null"> | 
|---|
|  |  |  | and manure_id = #{manureId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | limit 0,1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|