|  |  | 
 |  |  |     from rm_intake_amount_day_last riadl | 
 |  |  |     Left join pr_intake pint on pint.id = riadl.intake_id | 
 |  |  |     <where> | 
 |  |  |       <if test="intakeName != null"> | 
 |  |  |         and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') | 
 |  |  |       <if test="intakeId != null and intakeId != '' "> | 
 |  |  |         and rash.intake_id = #{intakeId} | 
 |  |  |       </if> | 
 |  |  |       <if test="intakeId != null"> | 
 |  |  |         and riadl.intake_id = #{intakeId} | 
 |  |  |       <if test="intakeName != null and intakeName != '' "> | 
 |  |  |         and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') | 
 |  |  |       </if> | 
 |  |  |       <if test="startDt != null"> | 
 |  |  |         and riadl.dt >= #{startDt,jdbcType=DATE} | 
 |  |  | 
 |  |  |     from rm_intake_amount_day_last riadl | 
 |  |  |     Left join pr_intake pint on pint.id = riadl.intake_id | 
 |  |  |     <where> | 
 |  |  |       <if test="intakeName != null"> | 
 |  |  |         and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') | 
 |  |  |       <if test="intakeId != null and intakeId != '' "> | 
 |  |  |         and rash.intake_id = #{intakeId} | 
 |  |  |       </if> | 
 |  |  |       <if test="intakeId != null"> | 
 |  |  |         and riadl.intake_id = #{intakeId} | 
 |  |  |       <if test="intakeName != null and intakeName != '' "> | 
 |  |  |         and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') | 
 |  |  |       </if> | 
 |  |  |       <if test="startDt != null"> | 
 |  |  |         and riadl.dt >= #{startDt,jdbcType=DATE} |