CalllogDao.xml 1.0 KB
<?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.w1hd.zzhnc.dao.CalllogDao">
 <select id="getCalllogList" resultType="com.w1hd.zzhnc.vo.Calllog_Vo">
		select a.*,b.nickname,b.logo,c.name as salename from calllog a
		left join fans b on a.fansid=b.id
		LEFT JOIN sales c on a.salesid=c.id
		<where>
		  <if test="keyword !=null and keyword!='' ">
				and (b.nickname like CONCAT(CONCAT('%',#{keyword}),'%')
				or
				c.name like CONCAT(CONCAT('%',#{keyword}),'%'))
			</if>
		</where>
		 order by a.createdtime desc
		limit #{0},#{1}
	</select>
	
	<select id="getCalllogCount" resultType="java.lang.Integer">
	 select count(a.id) from calllog a
		left join fans b on a.fansid=b.id
		LEFT JOIN sales c on a.salesid=c.id
		<where>
		  <if test="keyword !=null and keyword!='' ">
				and (b.nickname like CONCAT(CONCAT('%',#{keyword}),'%')
				or
				c.name like CONCAT(CONCAT('%',#{keyword}),'%'))
			</if>
		</where>
	</select>
</mapper>