<select id="selectByBcIdLikeName" resultMap="PlayServiceWithPic_ResultMap"
parameterType="java.util.Map">
SELECT
<include refid="PlayService_Column_List"/>
,
<include refid="PlayServiceMultimedia_Column_List"/>
FROM
playservice AS ps
LEFT OUTER JOIN playservicemultimedia AS psm ON ps.objectId = psm.serviceId
WHERE
ps.bcId = #{bcId,jdbcType=VARCHAR}
and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%' )
AND ps.STATUS = 1
AND UNIX_TIMESTAMP() > UNIX_TIMESTAMP(ps.saleStartTime)
AND UNIX_TIMESTAMP() < UNIX_TIMESTAMP(ps.saleEndTime)
ORDER BY
ps.orderField ASC,
ps.updatedAt DESC,
ps.createdAt DESC
</select>
<sql id="PlayService_Column_List">
ps.objectId AS ps_objectId,
ps.NAME AS ps_name,
ps.bcId AS ps_bcId,
ps.bcType AS ps_bcType,
ps.saleCount AS ps_saleCount,
ps.commentCount AS ps_commentCount,
ps.starCount AS ps_starCount,
ps.ageStart AS ps_ageStart,
ps.ageEnd AS ps_ageEnd,
ps.currentPrice AS ps_currentPrice,
ps.price AS ps_price,
ps.updatedAt AS ps_updatedAt,
ps.starTotalCount AS ps_starTotalCount,
ps.starTotalTimes AS ps_starTotalTimes
</sql>
<sql id="PlayServiceMultimedia_Column_List">
psm.objectId AS psm_objectId,
psm.url AS psm_url
</sql>