< sqlMap namespace ="dissent" >
<!-- 类别名 -->
< typeAlias alias ="BLDissent"
type ="com.sinosig.atip.dissent.model.BLDissentModel" />
<!-- 2012年08月01日 atip-15 根据被投诉机构代码查询机构名称 团长 始终 -->
< sql id ="dissent.queryOrgNameByCode" >
(select o.comcname from
t_atip_organization o where
o.comcode=d.COMPLAINTEDORGANIZATION) as
COMPLAINTEDORGANIZATIONNAME
</ sql >
<!-- 2012年07月26日 atip-15 分页查询的where子句 团长 -->
< sql id ="dissent.queryPaged.where" >
< isNotEmpty prepend ="and" property ="complaintNo" >
d.complaintno like
'%$complaintNo$%'
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintDateStart" >
<![CDATA[ d.complaintdate >=
date'$complaintDateStart$']]>
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintDateEnd" >
<![CDATA[d.complaintdate < =
date'$complaintDateEnd$']] >
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintedOrganization" >
d.complaintedorganization =#complaintedOrganization#
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintedPerson" >
d.complaintedperson
like
'%$complaintedPerson$%'
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintInsuType" >
d.complaintinsutype
like
'%$complaintInsuType$%'
</ isNotEmpty >
< isNotEmpty prepend ="and" property ="complaintContent" >
d.complaintcontent like
'%$complaintContent$%'
</ isNotEmpty >
</ sql >
<!-- 2012年07月26日 atip-15 查询分页数据的sql 团长 -->
<!-- 2012年08月02日 atip-15 按投诉时间排序 团长 -->
< sql id ="dissent.queryPagedList" >
select d.seqno,d.complaintno,
d.complaintdate,
d.complaintedorganization,
d.complaintedperson,
d.complaintinsutype,
d.complaintcontent,
< include refid ="dissent.queryOrgNameByCode" />
from
t_atip_dissent d
where 1=1
< include refid ="dissent.queryPaged.where" />
order by d.complaintdate
</ sql >
<!-- 2012年07月26日 atip-15 查询分页数据总量的sql 团长 -->
< select id ="dissent.queryPagedCount" parameterClass ="BLDissent"
resultClass ="java.lang.Integer" >
select count(0)
from t_atip_dissent d where 1=1
< include refid ="dissent.queryPaged.where" />
</ select >
<!-- 2012年07月26日 atip-15 查询单个数据的sql 团长 -->
< select id ="dissent.querySingleDissentBySeqno" parameterClass ="BLDissent"
resultClass ="BLDissent" >
select d.SEQNO,
d.COMPLAINTNO,
d.COMPLAINTDATE,
d.CLIENTAREA,
d.COMPLAINTORNAME,
d.CLIENTSEX,
d.TELEPHONE,
d.CLIENTTYPE,
d.INSUREDNAME,
d.COMPLAINTEDORGANIZATION,
< include refid ="dissent.queryOrgNameByCode" />
,
d.COMPLAINTEDPERSON,
d.COMPLAINTINSUTYPE,
d.COMPLAINTTYPE,
d.CARLICENCENO,
d.POLICYNO,
d.ACCIDENTNO,
d.COMPLAINTCONTENT,
d.DEALRESULT,
d.ISSECONDTIME,
d.DEALRESULTHISTORY,
d.CREATER,
d.UPDATER
from t_atip_dissent d
where d.seqno
=#seqNo#
</ select >
<!-- 2012年07月27日 atip-15 插入数据的sql 团长 始终 -->
< insert id ="dissent.addSingleDissent" parameterClass ="BLDissent" >
< selectKey keyProperty ="seqNo" resultClass ="java.lang.Integer" >
SELECT
t_atip_dissent_SEQ.NEXTVAL AS seqNo FROM DUAL
</ selectKey >
insert into t_atip_dissent(
SEQNO,
COMPLAINTNO,
COMPLAINTDATE,
CLIENTAREA,
COMPLAINTORNAME,
CLIENTSEX,
TELEPHONE,
CLIENTTYPE,
INSUREDNAME,
COMPLAINTEDORGANIZATION,
COMPLAINTEDPERSON,
COMPLAINTINSUTYPE,
COMPLAINTTYPE,
CARLICENCENO,
POLICYNO,
ACCIDENTNO,
COMPLAINTCONTENT,
DEALRESULT,
ISSECONDTIME,
DEALRESULTHISTORY,
CREATEDATE,
CREATER) values(#seqNo#,
#complaintNo#,
#complaintDate#,
#clientArea#,
#complaintorName#,
#clientSex#,
#telephone#,
#clientType#,
#insuredName#,
#complaintedOrganization#,
#complaintedPerson#,
#complaintInsuType#,
#complaintType#,
#carLicenceNo#,
#policyNo#,
#accidentNo#,
#complaintContent#,
#dealResult#,
#isSecondTime#,
#dealResultHistory#,
sysdate,
#creater#)
</ insert >
<!-- 2012年07月27日 atip-15 更新一条数据的方法 团长 始终 -->
< update id ="dissent.updateSingleDissentBySeqno" parameterClass ="BLDissent" >
update
t_atip_dissent set COMPLAINTNO=#complaintNo#,
COMPLAINTDATE=
#complaintDate#,
CLIENTAREA= #clientArea#,
COMPLAINTORNAME=
#complaintorName#,
CLIENTSEX= #clientSex#,
TELEPHONE= #telephone#,
CLIENTTYPE= #clientType#,
INSUREDNAME= #insuredName#,
COMPLAINTEDORGANIZATION= #complaintedOrganization#,
COMPLAINTEDPERSON=
#complaintedPerson#,
COMPLAINTINSUTYPE= #complaintInsuType#,
COMPLAINTTYPE= #complaintType#,
CARLICENCENO= #carLicenceNo#,
POLICYNO=
#policyNo#,
ACCIDENTNO= #accidentNo#,
COMPLAINTCONTENT=
#complaintContent#,
DEALRESULT= #dealResult#,
ISSECONDTIME=
#isSecondTime#,
DEALRESULTHISTORY= #dealResultHistory#,
UPDATEDATE=sysdate,
UPDATER= #updater#
where
SEQNO=#seqNo#
</ update >
<!-- 2012年07月27日 atip-15 删除一条数据的方法 团长 始终 -->
< delete id ="dissent.deleteSingleDissentBySeqno" parameterClass ="BLDissent" >
delete t_atip_dissent d where d.seqno =#seqNo#
</ delete >
</ sqlMap >