| | |
| | | tcr.deduct_money, |
| | | tcr.create_time, |
| | | tcr.update_time, |
| | | tcr.calculate_time |
| | | tcr.calculate_time, |
| | | tcr.which_year, |
| | | tcr.which_month |
| | | FROM |
| | | t_calculate_report tcr |
| | | INNER JOIN t_contract tc ON tcr.contract_id = tc.id |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <resultMap id="DetailResultMap" type="com.ycl.platform.domain.vo.CalculateReportDetailVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="unit_name" property="unitName"/> |
| | | <result column="name" property="contractName"/> |
| | | <result column="contract_id" property="contractId"/> |
| | | <result column="calculate_time" property="calculateTime"/> |
| | | <result column="deduct_money" property="deductMoney"/> |
| | | <collection property="ruleList" column="contract_id" ofType="com.ycl.platform.domain.vo.CalculateMoneyRuleVO" |
| | | select="selectRuleByContractId"/> |
| | | <collection property="recordList" column="contract_id" ofType="com.ycl.platform.domain.vo.CalculateRecordVO" |
| | | select="selectRecordByContractId"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectRuleByContractId" resultType="com.ycl.platform.domain.vo.CalculateMoneyRuleVO"> |
| | | SELECT id, |
| | | description, |
| | | score_condition as scoreCondition |
| | | FROM t_calculate_money_rule |
| | | WHERE contract_id = #{contractId} |
| | | AND deleted = 0 |
| | | </select> |
| | | |
| | | <select id="selectRecordByContractId" resultType="com.ycl.platform.domain.vo.CalculateRecordVO"> |
| | | SELECT |
| | | id, |
| | | create_time as createTime, |
| | | score, |
| | | deduct_money as deductMoney |
| | | FROM |
| | | t_calculate_record |
| | | WHERE |
| | | contract_id = #{contractId} AND deleted = 0 |
| | | </select> |
| | | |
| | | <select id="getById" resultMap="DetailResultMap"> |
| | | SELECT tyu.unit_name, |
| | | tc.name, |
| | | tcr.id, |
| | | tcr.contract_id, |
| | | tcr.deduct_money, |
| | | tcr.create_time, |
| | | tcr.update_time, |
| | | tcr.calculate_time |
| | | FROM t_calculate_report 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.id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |