| | |
| | | tc.name as contractName, |
| | | tcr.which_year, |
| | | tcr.which_month, |
| | | tcr.which_day, |
| | | MAX(tcr.which_day) AS latest_day, |
| | | SUM(tcr.deduct_money) AS deductMoney, |
| | | MAX(tcr.which_month) AS latest_month, |
| | | ( |
| | |
| | | AND tcr.status = #{query.status} |
| | | </if> |
| | | </where> |
| | | group by contract_id,which_year |
| | | group by contract_id, which_year,which_month |
| | | </select> |
| | | <resultMap id="DetailResultMap" type="com.ycl.platform.domain.vo.CalculateReportDetailVO"> |
| | | <result column="id" property="id"/> |
| | |
| | | <result column="name" property="contractName"/> |
| | | <result column="contract_id" property="contractId"/> |
| | | <result column="which_year" property="whichYear"/> |
| | | <result column="which_month" property="whichMonth"/> |
| | | <result column="status" property="status"/> |
| | | <collection property="ruleList" column="contract_id" ofType="com.ycl.platform.domain.vo.CalculateMoneyRuleVO" |
| | | select="selectRuleByContractId"/> |
| | | <collection property="recordList" column="{contractId=contract_id, whichYear=which_year,status=status}" ofType="com.ycl.platform.domain.vo.CalculateRecordVO" |
| | | <collection property="recordList" column="{contractId=contract_id, whichYear=which_year,status=status,whichMonth=which_month}" ofType="com.ycl.platform.domain.vo.CalculateRecordVO" |
| | | select="selectRecordByContractId"/> |
| | | </resultMap> |
| | | |
| | |
| | | tcr.deduct_money as deductMoney, |
| | | tcr.which_year as whichYear, |
| | | tcr.which_month as whichMonth, |
| | | tcr.which_day as whichDay, |
| | | tcr.status |
| | | FROM |
| | | t_calculate_record tcr |
| | |
| | | AND MONTH(tcs.create_time) = tcr.which_month |
| | | AND tcs.auditing_status = 'PASS' |
| | | <where> |
| | | tcr.contract_id = #{contractId} AND tcr.which_year = #{whichYear} AND tcr.deleted = 0 |
| | | tcr.contract_id = #{contractId} AND tcr.which_year = #{whichYear} AND tcr.deleted = 0 AND tcr.which_month=#{whichMonth} |
| | | <if test="status!=null"> |
| | | AND tcr.status=#{status} |
| | | </if> |
| | |
| | | tcr.create_time, |
| | | tcr.update_time, |
| | | tcr.which_year, |
| | | tcr.which_month, |
| | | #{query.status} as status |
| | | FROM t_calculate_record tcr |
| | | INNER JOIN t_contract tc ON tcr.contract_id = tc.id |
| | | INNER JOIN t_yw_unit tyu ON tyu.id = tc.unit_id |
| | | <where> |
| | | tcr.contract_id = #{query.contractId} AND tcr.which_year = #{query.whichYear} |
| | | tcr.contract_id = #{query.contractId} AND tcr.which_year = #{query.whichYear} AND tcr.which_month = #{query.whichMonth} |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | |
| | | a.rule_name as ruleName, |
| | | a.rule_condition as detailName, |
| | | COUNT(b.id) AS num, |
| | | a.calc_fraction as calcFraction, |
| | | IFNULL(-SUM(b.score), 0) AS score |
| | | FROM t_calculate_rule a |
| | | LEFT JOIN t_calculate_record tcr ON a.contract_id = tcr.contract_id |
| | |
| | | <if test="whichYear!=null"> |
| | | and tcr.which_year = #{whichYear} |
| | | </if> |
| | | <if test="whichDay!=null"> |
| | | and tcr.which_day = #{whichDay} |
| | | </if> |
| | | </where> |
| | | GROUP BY a.id |
| | | </select> |