| | |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectClientIds4DayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientIdAmountYearRecord"> |
| | | select |
| | | mtb.id as clientId |
| | | from se_client mtb |
| | | where mtb.deleted != 1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="name != null and name != ''"> |
| | | mtb.name like concat('%', #{name}, '%') |
| | | </if> |
| | | </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} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountDay"> |
| | | select |
| | | mtb.id as clientId, |
| | |
| | | <property name="alias" value="stTb"/> |
| | | </include> |
| | | from se_client mtb |
| | | LEFT JOIN st_client_amount_day stTb on stTb.client_id = mtb.id |
| | | where mtb.deleted != 1 |
| | | <trim prefix="and" suffixOverrides="and"> |
| | | <if test="clientIdsJson != null and clientIdsJson !=''"> |
| | | INNER JOIN JSON_TABLE( |
| | | <!--'[{"clientId":"37142501020100215"},{"clientId":"37142501020100215"}]'--> |
| | | #{clientIdsJson}, |
| | | '$[*]' COLUMNS ( |
| | | clientId BIGINT PATH '$.clientId' |
| | | ) |
| | | ) clientIdTb ON clientIdTb.clientId = mtb.id |
| | | </if> |
| | | LEFT JOIN |
| | | ( |
| | | select * |
| | | from st_client_amount_day |
| | | <where> |
| | | <if test = "year != null"> |
| | | stTb.year = #{year, jdbcType=INTEGER} |
| | | `year` = #{year,jdbcType=INTEGER} |
| | | </if> |
| | | <if test = "month != null"> |
| | | AND stTb.month = #{month, jdbcType=INTEGER} |
| | | AND month = #{month, jdbcType=INTEGER} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND mtb.name like concat('%', #{name}, '%') |
| | | </if> |
| | | </trim> |
| | | </where> |
| | | ) as stTb on stTb.client_id = mtb.id |
| | | where mtb.deleted != 1 |
| | | order by mtb.id DESC |
| | | <!-- 2025-07-14 因为有clientIdsJson限制了数量,所以不再用limit了 |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | --> |
| | | </select> |
| | | |
| | | <!-- ////////////////////////////////// --> |