34 lines
1.7 KiB
XML
34 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com._3e.dao.GoodsPriceDefiDao">
|
|
<select id= "findBySchoolid" parameterType="long" resultType="com._3e.http.pay.dto._3EResGoodsPriceDefi" >
|
|
SELECT g.schoolid, s.goodsname , g.years, g.price, g.amount, g.description, g.starttime, g.endtime,g.jcontent
|
|
FROM goodspricedefi g JOIN goods s ON g.goodsid = s.goodsid
|
|
WHERE (schoolid = #{schoolid} or schoolid = 0) and type = 1
|
|
ORDER BY g.schoolid ASC , g.years ASC
|
|
</select>
|
|
|
|
<select id= "findByClassesId" parameterType="long" resultType="com._3e.http.pay.dto._3EResGoodsPriceDefi" >
|
|
SELECT g.schoolid, s.goodsname , g.years, g.price, g.amount, g.description, g.starttime, g.endtime,g.jcontent
|
|
FROM goodspricedefi g JOIN goods s ON g.goodsid = s.goodsid
|
|
WHERE (schoolid = #{classesId} or schoolid = 0) and type = 2
|
|
ORDER BY g.schoolid ASC , g.years ASC
|
|
</select>
|
|
|
|
<select id= "findByAreaId" parameterType="long" resultType="com._3e.http.pay.dto._3EResGoodsPriceDefi" >
|
|
SELECT g.schoolid, s.goodsname , g.years, g.price, g.amount, g.description, g.starttime, g.endtime,g.jcontent
|
|
FROM goodspricedefi g JOIN goods s ON g.goodsid = s.goodsid
|
|
WHERE (schoolid = #{areaId} or schoolid = 0) and type = 3
|
|
ORDER BY g.schoolid ASC , g.years ASC
|
|
</select>
|
|
<select id="findAll" resultType="com._3e.http.pay.dto._3EResGoodsPriceDefi">
|
|
SELECT g.schoolid, s.goodsname , g.years, g.price, g.amount, g.description, g.starttime, g.endtime,g.jcontent
|
|
FROM goodspricedefi g JOIN goods s ON g.goodsid = s.goodsid
|
|
WHERE g.schoolid = 0 and type = 1 and g.startTime < #{date} and g.endTime >#{date}
|
|
ORDER BY g.schoolid ASC , g.years ASC limit 1
|
|
</select>
|
|
|
|
</mapper>
|