| | |
| | | |
| | | <select id="getData" resultMap="VolunteerCreditsExchangeMap"> |
| | | select |
| | | id, |
| | | order_number, |
| | | goods_id, |
| | | (select vim.name from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_name, |
| | | (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_url, |
| | | need_score, |
| | | user_id, |
| | | (select sy.name from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userName, |
| | | (select sy.phone from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userPhone, |
| | | creation_time, |
| | | condition, |
| | | dispose_time, |
| | | community_id, |
| | | update_time |
| | | from volunteer_credits_exchange |
| | | where volunteer_credits_exchange.id=#{id} |
| | | vce.id, |
| | | vce.order_number, |
| | | vce.goods_id, |
| | | (select vim.name from volunteer_integral_merchant as vim where vim.id=vce.goods_id) as goods_name, |
| | | (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=vce.goods_id) as goods_url, |
| | | vce.need_score, |
| | | vce.user_id, |
| | | (select sy.name from sys_user as sy where sy.user_id=vce.user_id) as userName, |
| | | (select sy.phone from sys_user as sy where sy.user_id=vce.user_id) as userPhone, |
| | | vce.creation_time, |
| | | vce.condition, |
| | | vce.dispose_time, |
| | | vce.community_id, |
| | | vce.update_time |
| | | from volunteer_credits_exchange as vce |
| | | where vce.id=#{id} |
| | | </select> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="getList" resultMap="VolunteerCreditsExchangeMap"> |
| | | select |
| | | id, |
| | | order_number, |
| | | goods_id, |
| | | (select vim.name from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_name, |
| | | (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=volunteer_credits_exchange.good_id) as goods_url, |
| | | need_score, |
| | | user_id, |
| | | (select sy.name from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userName, |
| | | (select sy.phone from sys_user as sy where sy.user_id=volunteer_credits_exchange.user_id) as userPhone, |
| | | creation_time, |
| | | condition, |
| | | dispose_time, |
| | | community_id, |
| | | update_time |
| | | from volunteer_credits_exchange |
| | | vce.id, |
| | | vce.order_number, |
| | | vce.goods_id, |
| | | (select vim.name from volunteer_integral_merchant as vim where vim.id=vce..goods_id) as goods_name, |
| | | (select vim.cover_url from volunteer_integral_merchant as vim where vim.id=vce..goods_id) as goods_url, |
| | | vce.need_score, |
| | | vce.user_id, |
| | | (select sy.name from sys_user as sy where sy.user_id=vce..user_id) as userName, |
| | | (select sy.phone from sys_user as sy where sy.user_id=vce..user_id) as userPhone, |
| | | vce.creation_time, |
| | | vce.condition, |
| | | vce.dispose_time, |
| | | vce.community_id, |
| | | vce.update_time |
| | | from volunteer_credits_exchange as vce |
| | | <where> |
| | | 1=1 |
| | | <if test="goodsId!=null"> |
| | | and goods_id=#{goodsId} |
| | | and vce.goods_id=#{goodsId} |
| | | </if> |
| | | <if test="orderNumber!=null"> |
| | | and order_number=#{orderNumber} |
| | | and vce.order_number=#{orderNumber} |
| | | </if> |
| | | <if test="goodsName!=null"> |
| | | and goods_name=#{goodsName} |
| | | and vce.goods_name=#{goodsName} |
| | | </if> |
| | | <if test="condition!=null"> |
| | | and volunteer_credits_exchange.condition=#{condition} |
| | | and vce.condition=#{condition} |
| | | </if> |
| | | <if test="userName!=null"> |
| | | and ((select su.name from sys_user as su where su.user_id=volunteer_credits_exchange.user_id) like concat('%',#{userName},'%') |
| | | and ((select su.name from sys_user as su where su.user_id=vce.user_id) like concat('%',#{userName},'%') |
| | | </if> |
| | | <if test="communityId!=null"> |
| | | and community_id=#{communityId} |
| | | and vce.community_id=#{communityId} |
| | | </if> |
| | | <if test="userId!=null"> |
| | | and user_id=#{userId} |
| | | and vce.user_id=#{userId} |
| | | </if> |
| | | </where> |
| | | order by creation_time desc |
| | | order by vce.creation_time desc |
| | | </select> |
| | | |
| | | <insert id="insertData"> |