移风店镇项目初始化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

149 lines
4.7 KiB

<?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.epmet.modules.partymember.dao.IcPartyMemberPointDao">
<select id="getList"
resultType="com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO">
SELECT
c.PARTY_ORG_NAME as partyOrg,
u.NAME,
u.MOBILE,
u.ID_CARD,
u.REMARK,
a.year,
sum( a.BASE_POINT ) AS BasePoint,
sum( a.REVIEW_POINT ) AS reviewPoint,
sum( a.INSPIRE_POINT ) AS inspirePoint,
sum( a.WARN_POINT ) AS warnPoint
FROM
ic_party_member u
LEFT JOIN ic_party_member_point a ON a.PARTY_MEMBER_ID = u.id
AND a.DEL_FLAG = '0'
LEFT JOIN ic_party_org c ON c.id = u.sszb
AND c.DEL_FLAG = '0'
<where>
u.DEL_FLAG = '0'
AND u.CUSTOMER_ID = #{customerId}
<if test="name != null and name != ''">
AND u.NAME = #{name}
</if>
<if test="mobile != null and mobile != ''">
AND u.MOBILE = #{mobile}
</if>
<if test="idCard != null and idCard != ''">
AND u.ID_CARD = #{idCard}
</if>
<if test="year != null and year != ''">
AND a.YEAR = #{year}
</if>
<if test="orgId != null and orgId != ''">
AND c.id = #{orgId}
</if>
</where>
GROUP BY u.ID
ORDER BY
a.YEAR DESC,
u.sszb ASC,
a.total_score ASC,
a.CREATED_TIME
</select>
<select id="getListCount"
resultType="com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO">
SELECT
count( a.BASE_POINT ) AS basePointCount,
count( a.REVIEW_POINT ) AS reviewPointCount,
count( a.INSPIRE_POINT ) AS inspirePointCount,
count( a.WARN_POINT ) AS warnPointCount
FROM
ic_party_member u
LEFT JOIN ic_party_member_point a ON a.PARTY_MEMBER_ID = u.id
AND a.DEL_FLAG = '0'
<where>
u.DEL_FLAG = '0'
AND u.CUSTOMER_ID = #{customerId}
<if test="year != null and year != ''">
AND a.year = #{year}
</if>
</where>
GROUP BY
u.id
ORDER BY
a.YEAR DESC,
u.sszb ASC,
a.total_score ASC,
a.CREATED_TIME
</select>
<select id="getEchoPartyMemberPoint"
resultType="com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO">
SELECT
id,
BASE_POINT,
BASE_OPTIONS,
REVIEW_POINT,
REVIEW_OPTIONS,
INSPIRE_POINT,
INSPIRE_OPTIONS,
WARN_POINT,
WARN_OPTIONS
FROM
ic_party_member_point
where
year = #{year}
AND PARTY_MEMBER_ID = #{partyMemberId}
AND QUARTER = #{quarter}
AND DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
order by CREATED_TIME
</select>
<select id="getExport"
resultType="com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO">
SELECT
a.year,
a.QUARTER,
a.BASE_OPTIONS,
a.REVIEW_OPTIONS,
a.INSPIRE_OPTIONS,
a.WARN_OPTIONS,
a.TOTAL_SCORE,
a.PARTY_MEMBER_ID,
a.BASE_POINT,
a.REVIEW_POINT,
a.INSPIRE_POINT,
a.WARN_POINT
FROM
ic_party_member u
LEFT JOIN ic_party_member_point a ON a.PARTY_MEMBER_ID = u.id
AND a.DEL_FLAG = '0'
LEFT JOIN ic_party_org c ON c.id = u.sszb
AND c.DEL_FLAG = '0'
<where>
u.DEL_FLAG = '0'
<if test="form.name != null and form.name != ''">
AND u.NAME = #{form.name}
</if>
<if test="form.mobile != null and form.mobile != ''">
AND u.MOBILE = #{form.mobile}
</if>
<if test="form.idCard != null and form.idCard != ''">
AND u.ID_CARD = #{form.idCard}
</if>
<if test="form.year != null and form.year != ''">
AND a.YEAR = #{form.year}
</if>
<if test="form.orgId != null and form.orgId != ''">
AND c.id = #{form.orgId}
</if>
</where>
GROUP BY u.ID
ORDER BY
a.YEAR DESC,
u.sszb ASC,
a.total_score ASC,
a.CREATED_TIME
</select>
</mapper>