Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

434 wiersze
20 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxCouponChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponChannel">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  9. <result column="type" jdbcType="INTEGER" property="type" />
  10. <result column="title" jdbcType="VARCHAR" property="title" />
  11. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  12. <result column="business" jdbcType="INTEGER" property="business" />
  13. <result column="sub_business" jdbcType="INTEGER" property="subBusiness" />
  14. <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" />
  15. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" />
  16. <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
  17. <result column="status" jdbcType="INTEGER" property="status" />
  18. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  19. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  20. <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" />
  21. <result column="qr_code" property="qrCode"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. distinct cc.`id`,cc.`tenant_id`,cc.`parent_tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`,cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`show_begin_time`,cc.`begin_time`,cc.`end_time`,cc.`status`,cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1=1
  28. <if test="null != couponStatus">
  29. and c.status = #{couponStatus}
  30. </if>
  31. <if test="null != status ">
  32. and cc.status = #{status}
  33. </if>
  34. <if test="null == status ">
  35. and cc.status = 0
  36. </if>
  37. <if test=" null != id ">
  38. and cc.`id` = #{id}
  39. </if>
  40. <if test=" null != tenantId and '' != tenantId">
  41. and cc.`tenant_id` = #{tenantId}
  42. </if>
  43. <if test=" null != parentTenantId and '' != parentTenantId">
  44. and cc.`parent_tenant_id` = #{parentTenantId}
  45. </if>
  46. <if test=" null != couponId ">
  47. and cc.`coupon_id` = #{couponId}
  48. </if>
  49. <if test=" null != type ">
  50. and cc.`type` = #{type}
  51. </if>
  52. <if test=" null != title and ''!= title">
  53. and cc.`title` like concat('%', #{title},'%')
  54. </if>
  55. <if test=" null != targetAd ">
  56. and cc.`target_ad` = #{targetAd}
  57. </if>
  58. <if test=" null != business ">
  59. and cc.`business` = #{business}
  60. </if>
  61. <if test=" null != subBusiness ">
  62. and cc.`sub_business` = #{subBusiness}
  63. </if>
  64. <if test=" null != showBeginTime ">
  65. and cc.`show_begin_time` &lt;= #{showBeginTime}
  66. </if>
  67. <if test=" null != startdate and null!=enddate">
  68. and cc.`create_date` between #{startdate} and #{enddate}
  69. </if>
  70. <if test=" null != status ">
  71. and cc.`status` = #{status}
  72. </if>
  73. <if test=" null != createDate ">
  74. and cc.`create_date` = #{createDate}
  75. </if>
  76. <if test=" null != updateDate ">
  77. and cc.`update_date` = #{updateDate}
  78. </if>
  79. <if test=" null != subTargetId ">
  80. and cc.`sub_target_id` = #{subTargetId}
  81. </if>
  82. <if test=" null != supportTransfer ">
  83. and c.`support_transfer` = #{supportTransfer}
  84. </if>
  85. <if test=" null != userCredit ">
  86. and c.`credit_price` &lt;= #{userCredit}
  87. </if>
  88. <if test=" null != sourceType ">
  89. and c.`source_type` = #{sourceType}
  90. </if>
  91. <if test=" null != merchantId ">
  92. and cm.`merchant_id` = #{merchantId}
  93. </if>
  94. <if test=" null != ids ">
  95. and cc.id in
  96. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  97. #{idItem}
  98. </foreach>
  99. </if>
  100. <if test=" null != couponIds ">
  101. and cc.coupon_id in
  102. <foreach collection="couponIds" index="index" item="couponIdsItem" open="(" separator="," close=")">
  103. #{couponIdsItem}
  104. </foreach>
  105. </if>
  106. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  107. </sql>
  108. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  109. select <include refid="allColumns" /> from wx_coupon_channel cc where id = #{id} and tenant_id = #{tenantId}
  110. </select>
  111. <select id="findList" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="BaseResultMap">
  112. select <include refid="allColumns" /> from wx_coupon_channel cc
  113. <include refid="dynamicWhereConditions" />
  114. </select>
  115. <update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
  116. update wx_coupon_channel
  117. set status=#{status}, update_date=#{updateDate}
  118. where coupon_id=#{couponId}
  119. <if test=" null != tenantId and '' != tenantId">
  120. and `tenant_id` = #{tenantId}
  121. </if>
  122. <if test=" null != parentTenantId and '' != parentTenantId">
  123. and `parent_tenant_id` = #{parentTenantId}
  124. </if>
  125. </update>
  126. <update id="updateEndTimeByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">
  127. update wx_coupon_channel
  128. set end_time = #{endTime}
  129. where coupon_id=#{couponId}
  130. <if test=" null != tenantId and '' != tenantId">
  131. and `tenant_id` = #{tenantId}
  132. </if>
  133. <if test=" null != parentTenantId and '' != parentTenantId">
  134. and `parent_tenant_id` = #{parentTenantId}
  135. </if>
  136. </update>
  137. <sql id="CouponChannelVoColumns">
  138. <include refid="allColumns" />,
  139. c.remain_inventory,c.inventory,c.cover_img,c.sub_title,c.sale_price,c.detail,
  140. c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.use_limit_rule,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.conditions,
  141. c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.valid_days,c.credit_price,c.content_type,c.source_type
  142. </sql>
  143. <resultMap id="CouponChannelVoMap" type="com.iformall.domain.vo.WxCouponChannelVo">
  144. <id column="id" jdbcType="BIGINT" property="id" />
  145. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  146. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  147. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  148. <result column="type" jdbcType="INTEGER" property="type" />
  149. <result column="title" jdbcType="VARCHAR" property="title" />
  150. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  151. <result column="business" jdbcType="VARCHAR" property="business" />
  152. <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" />
  153. <result column="sub_business" jdbcType="INTEGER" property="subBusiness" />
  154. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  155. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  156. <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" />
  157. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  158. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  159. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  160. <result column="title" jdbcType="VARCHAR" property="title"/>
  161. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  162. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  163. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  164. <result column="price" jdbcType="INTEGER" property="price"/>
  165. <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
  166. <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
  167. <result column="unit" jdbcType="INTEGER" property="unit"/>
  168. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  169. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  170. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  171. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  172. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  173. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  174. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  175. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  176. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  177. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  178. <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
  179. <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>
  180. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  181. <result column="qr_code" property="qrCode"/>
  182. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  183. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  184. <result column="source_type" jdbcType="INTEGER" property="sourceType"/>
  185. <collection column="{productId=coupon_id,tenantId=tenant_id}" property="merchantVoList"
  186. ofType="com.iformall.domain.vo.WxMerchantVo"
  187. javaType="java.util.List"
  188. select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantNameList" >
  189. </collection>
  190. </resultMap>
  191. <select id="findVoList" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="CouponChannelVoMap">
  192. select <include refid="CouponChannelVoColumns" />
  193. from wx_coupon_channel cc
  194. left join wx_coupon c on cc.coupon_id = c.id
  195. left join wx_coupon_merchant cm on c.id = cm.product_id and cm.status = 0
  196. <include refid="dynamicWhereConditions" />
  197. </select>
  198. <select id="findVoListByMerchant" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="CouponChannelVoMap">
  199. select <include refid="CouponChannelVoColumns" />
  200. from wx_coupon_channel cc
  201. join wx_coupon_merchant cm
  202. on cm.product_id = cc.coupon_id
  203. and cm.status = 0
  204. <if test="merchantId != null">
  205. and cm.merchant_id=#{merchantId}
  206. </if>
  207. <if test=" null != merchantIds ">
  208. and cm.merchant_id in
  209. <foreach collection="merchantIds" index="index" item="item" open="(" separator="," close=")">
  210. #{item}
  211. </foreach>
  212. </if>
  213. left join wx_coupon c on cc.coupon_id = c.id
  214. left join wx_merchant mer on cm.merchant_id = mer.id
  215. where cc.`target_ad` in (1,2,5,6,7)
  216. <if test="status != null">
  217. and cc.status=#{status}
  218. </if>
  219. <if test=" null != tenantId and '' != tenantId">
  220. and cc.`tenant_id` = #{tenantId}
  221. </if>
  222. <if test=" null != parentTenantId and '' != parentTenantId">
  223. and cc.`parent_tenant_id` = #{parentTenantId}
  224. </if>
  225. <if test=" null != showBeginTime ">
  226. and cc.`show_begin_time` &lt;= #{showBeginTime}
  227. </if>
  228. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  229. </select>
  230. <sql id="WxCouponCVoColumn">
  231. cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time,
  232. c.tenant_id,c.parent_tenant_id,c.type,c.cover_img,c.cover_picture,c.detail_picture,c.title,c.sub_title,c.sale_price,c.use_price,
  233. c.use_limit_rule,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,
  234. c.valid_days,c.detail,c.price,c.tail_price,c.orig_price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,
  235. c.create_date,c.update_date,c.business,c.sub_business,c.support_transfer,c.press_limit_num, c.auto_refund,c.credit_price,c.conditions,c.content_type,
  236. cc.qr_code
  237. </sql>
  238. <sql id="CVoStatusColumn">
  239. cc.id,cc.coupon_id,c.remain_inventory,c.status
  240. </sql>
  241. <resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo">
  242. <id column="id" jdbcType="BIGINT" property="id"/>
  243. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  244. <result column="type" jdbcType="INTEGER" property="type" />
  245. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  246. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
  247. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  248. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  249. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  250. <result column="type" jdbcType="INTEGER" property="type"/>
  251. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  252. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  253. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  254. <result column="title" jdbcType="VARCHAR" property="title"/>
  255. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  256. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  257. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  258. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  259. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  260. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  261. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  262. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  263. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  264. <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
  265. <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>
  266. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  267. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  268. <result column="price" jdbcType="INTEGER" property="price"/>
  269. <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
  270. <result column="orig_price" jdbcType="INTEGER" property="origPrice"/>
  271. <result column="unit" jdbcType="INTEGER" property="unit"/>
  272. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  273. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  274. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  275. <result column="status" jdbcType="INTEGER" property="status"/>
  276. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  277. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  278. <result column="business" jdbcType="INTEGER" property="business"/>
  279. <result column="subBusiness" jdbcType="INTEGER" property="subBusiness"/>
  280. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  281. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  282. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  283. <result column="qr_code" property="qrCode"/>
  284. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  285. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  286. <collection column="{productId=coupon_id,tenantId=tenant_id}" property="merchantVoList"
  287. ofType="com.iformall.domain.vo.WxMerchantVo"
  288. javaType="java.util.List"
  289. select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantVoList" >
  290. </collection>
  291. </resultMap>
  292. <resultMap id="WxCouponCVoMapL" type="com.iformall.domain.vo.WxCouponCVo">
  293. <id column="id" jdbcType="BIGINT" property="id"/>
  294. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  295. <result column="type" jdbcType="INTEGER" property="type" />
  296. <result column="target_ad" jdbcType="INTEGER" property="targetAd" />
  297. <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
  298. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  299. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  300. <result column="type" jdbcType="INTEGER" property="type"/>
  301. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  302. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  303. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  304. <result column="title" jdbcType="VARCHAR" property="title"/>
  305. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  306. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  307. <result column="use_price" jdbcType="INTEGER" property="usePrice"/>
  308. <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule" />
  309. <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/>
  310. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  311. <result column="valid_type" jdbcType="INTEGER" property="validType"/>
  312. <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/>
  313. <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
  314. <result column="valid_days" jdbcType="INTEGER" property="validDays"/>
  315. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  316. <result column="price" jdbcType="INTEGER" property="price"/>
  317. <result column="unit" jdbcType="INTEGER" property="unit"/>
  318. <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory"/>
  319. <result column="inventory" jdbcType="INTEGER" property="inventory"/>
  320. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  321. <result column="status" jdbcType="INTEGER" property="status"/>
  322. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  323. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  324. <result column="business" jdbcType="INTEGER" property="business"/>
  325. <result column="subBusiness" jdbcType="INTEGER" property="subBusiness"/>
  326. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  327. <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/>
  328. <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
  329. <result column="qr_code" property="qrCode"/>
  330. <result column="conditions" jdbcType="VARCHAR" property="conditions" />
  331. <result column="content_type" jdbcType="INTEGER" property="contentType"/>
  332. </resultMap>
  333. <select id="findVoDetail" parameterType="java.util.HashMap" resultMap="WxCouponCVoMap">
  334. select
  335. <include refid="WxCouponCVoColumn"/>
  336. from wx_coupon_channel cc
  337. left join wx_coupon c on cc.coupon_id = c.id
  338. where cc.id = #{id} and cc.tenant_id = #{tenantId}
  339. </select>
  340. <select id="findVoStatusDetail" parameterType="java.util.HashMap" resultMap="WxCouponCVoMapL">
  341. select
  342. <include refid="CVoStatusColumn"/>
  343. from wx_coupon c, wx_coupon_channel cc
  344. where cc.coupon_id = c.id and cc.id = #{id} and cc.tenant_id = #{tenantId}
  345. </select>
  346. <select id="countCoupon" parameterType="com.iformall.domain.po.WxCouponChannel" resultType="java.lang.Integer">
  347. select count(distinct coupon_id) from wx_coupon_channel cc
  348. <include refid="dynamicWhereConditions" />
  349. </select>
  350. <select id="countCouponChannel" parameterType="com.iformall.domain.po.WxCouponChannel" resultType="java.lang.Integer">
  351. select count(*) from wx_coupon_channel cc
  352. <include refid="dynamicWhereConditions" />
  353. </select>
  354. <update id="offExpiriedCouponChannelByEndTime" parameterType="String">
  355. update wx_coupon_channel SET status = 1, update_date = now()
  356. where status = 0 and tenant_id = #{tenantId} and end_time &lt; now()
  357. </update>
  358. <update id="offExpiriedCouponChannelByValidDate">
  359. update wx_coupon_channel cc, wx_coupon c SET cc.status = 1, cc.update_date = now()
  360. where cc.status = 0 and cc.tenant_id = #{tenantId} and cc.coupon_id = c.id and c.valid_type = 1 and c.valid_end_date &lt; now()
  361. </update>
  362. <update id="offExpiriedCouponChannelByCouponStatus">
  363. update wx_coupon_channel cc, wx_coupon c SET cc.status = 1, cc.update_date = now()
  364. where cc.status = 0 and cc.tenant_id = #{tenantId} and cc.coupon_id = c.id and c.status = 1
  365. </update>
  366. <update id="offExpiriedCouponChannel2ByEndTime">
  367. update wx_coupon_channel SET status = 1, update_date = now()
  368. where status = 0 and tenant_id = #{tenantId} and target_ad = 2 and end_time &lt; now()
  369. </update>
  370. <delete id="delByTopic" parameterType="com.iformall.domain.po.WxTopic">
  371. update wx_coupon_channel set status = 1 where sub_target_id = #{id}
  372. </delete>
  373. <select id="findQrcodeEmptyList" resultType="com.iformall.domain.po.WxCouponChannel">
  374. select * from wx_coupon_channel where qr_code is null
  375. </select>
  376. <update id="cardDefer">
  377. update wx_coupon_channel set end_time = #{endTime} where coupon_id = #{couponId} and tenant_id = #{tenantId} and target_ad = 5 and type = 100
  378. </update>
  379. </mapper>