<mapper namespace="com.cn.shoje.oa.modules.logistics.dao.purcdao">
<select id="findall" parametertype="map" resulttype="purchase">
select * from prod_purchase where 1=1
<if test="purc_id!=''"> and purc_id=#{purc_id}</if>
<if test="prod_id!=''"> and prod_id=#{prod_id}</if>
<if test="ch_id!=''"> and ch_id=#{ch_id}</if>
<if test="ch_name!=''"> and ch_id in ( select ch_id from channel where ch_name
like '%#{ch_name}%')</if>
<if test="purc_time!=''"> and purc_time=#{purc_time} order by #{purc_time} desc
</if>
</select>
</mapper>
<update id="publisht00_notice" parametertype="map">
update test
set createdate = #{createdate},
creator = #{creator}
where id in
<foreach collection="ids" item="ids" separator="," open="(" close=")">
#{ids}
</foreach>
</update>
<if test="params.accountid!=null">
and a.accountid=#{params.accountid}
</if>
<if test="params.nickname!=null and params.nickname !=''">
and a.nickname like '%${params.nickname}%'
</if>
<if test="params.begindate!=null and params.begindate!=''">
and date_format(a.createtime,'%y-%m-%d')>=${params.begindate}
</if>
<if test="params.enddate!=null and params.enddate!=''">
<![cdata[ and date_format(a.createtime,'%y-%m-%d')<=${params.enddate} ]]>
</if>