<!--created by util.you.com@gmail.com search--><selectid="search"parameterType="java.util.Map"resultMap="reFundList">
SELECT
csr.id,
csr.strategy_name,
csr.remark,
csr.`status`,
sut.username,
DATE_FORMAT(IFNULL(csr.insert_time, ''), '%Y-%m-%d %H:%i:%s') AS insert_time
FROM
`CL_STRATEGY_REFUND` AS csr
LEFT JOIN
`SYS_USER_TBL` AS sut ON sut.user_id = csr.insert_user_id
WHERE
csr.`status` = 1
<iftest="strategyName != null and strategyName != ''">
AND csr.strategy_name LIKE CONCAT('%',#{strategyName}, '%')
</if>
ORDER BY csr.id DESC
<iftest="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
;
</select><!--created by util.you.com@gmail.com search 因为这里返回类型(即封装类型)是 Map,所以 property 的值就是 Map 封装的 key 名称--><resultMapid="reFundList"type="java.util.Map"><idcolumn="id"property="id"/><resultcolumn="strategy_name"property="strategyName"/><resultcolumn="remark"property="remark"/><resultcolumn="username"property="userName"/><resultcolumn="insert_time"property="insertTime"/><collectionproperty="ruleList"javaType="ArrayList"column="id"select="selectReFundInfo"/></resultMap><!--created by util.you.com@gmail.com search--><selectid="selectReFundInfo"parameterType="java.lang.Integer"resultType="java.util.Map">
select
csrr.id,
csrr.strategy_id,
csrr.time_limit,
csrr.fee_type,
csrr.fee_value
from
`CL_STRATEGY_REFUND_REL` as csrr
where
csrr.`status` = 1 and csrr.strategy_id = #{id}
</select>