|  |  |  | 
|---|
|  |  |  | times30, amount31, money31, times31 | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  | <sql id="Base_Column_List_with_alias"> | 
|---|
|  |  |  | <!--@mbg.generated--> | 
|---|
|  |  |  | ${alias}.id, ${alias}.client_id, ${alias}.`year`, ${alias}.`month`, ${alias}.amount1, ${alias}.money1, ${alias}.times1, ${alias}.amount2, ${alias}.money2, ${alias}.times2, | 
|---|
|  |  |  | ${alias}.amount3, ${alias}.money3, ${alias}.times3, ${alias}.amount4, ${alias}.money4, ${alias}.times4, ${alias}.amount5, ${alias}.money5, ${alias}.times5, ${alias}.amount6, | 
|---|
|  |  |  | ${alias}.money6, ${alias}.times6, ${alias}.amount7, ${alias}.money7, ${alias}.times7, ${alias}.amount8, ${alias}.money8, ${alias}.times8, ${alias}.amount9, ${alias}.money9, | 
|---|
|  |  |  | 
|---|
|  |  |  | select | 
|---|
|  |  |  | count(*) | 
|---|
|  |  |  | from se_client mtb | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | where mtb.deleted != 1 | 
|---|
|  |  |  | <trim prefix="and" suffixOverrides="and"> | 
|---|
|  |  |  | <if test="name != null and name != ''"> | 
|---|
|  |  |  | mtb.name like concat('%', #{name}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectDayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountDay"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | mtb.id as clientId, | 
|---|
|  |  |  | mtb.clientNum as clientNum, | 
|---|
|  |  |  | mtb.phone as clientPhone, | 
|---|
|  |  |  | mtb.name as clientName, | 
|---|
|  |  |  | mtb.address as clientAddress, | 
|---|
|  |  |  | <include refid="Base_Column_List_with_alias" > | 
|---|
|  |  |  | <property name="alias" value="stTb"/> | 
|---|
|  |  |  | </include> | 
|---|
|  |  |  | from se_client mtb | 
|---|
|  |  |  | LEFT JOIN st_client_amount_day stTb on stTb.client_id = mtb.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | where mtb.deleted != 1 | 
|---|
|  |  |  | <trim prefix="and" suffixOverrides="and"> | 
|---|
|  |  |  | <if test = "year != null"> | 
|---|
|  |  |  | stTb.year = #{year, jdbcType=INTEGER} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="name != null and name != ''"> | 
|---|
|  |  |  | AND mtb.name like concat('%', #{name}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | order by mtb.id ASC | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | order by mtb.id DESC | 
|---|
|  |  |  | <trim prefix="limit " > | 
|---|
|  |  |  | <if test="start != null and count != null"> | 
|---|
|  |  |  | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|---|