date_format(policy.INS_MST_ACCEPT_DATE, '%Y-%m-%d %H:%i:%s') as orderDate, -- 下单日期
date_format(policy.INS_MST_EFFECT_DATE, '%Y-%m-%d %H:%i:%s') as startDate, -- 保险起期
date_format(policy.INS_MST_INVALID_DATE, '%Y-%m-%d %H:%i:%s') as endDate, -- 保险止期
product.PRD_MST_ID as productId , -- 产品编号
product.PRD_MST_INS_CODE as productCode , -- 产品code
product.PRD_MST_PRO_NAME as productName , -- 产品名字
insurer.PRD_SUP_ID as insurerId , -- 保险公司编号
insurer.PRD_SUP_NAME as insurerName , -- 保险公司名称
holder.CUS_MST_NAME as holderName, -- 投保人姓名
holder.CUS_MST_ID as holderId, -- 投保人编码
holder.CUS_MST_ID_NUM as holderIdNo, -- 投保人编码
holder.CUS_MST_SEX as holderSex, -- 投保人性别
holder.CUS_MST_BIRTHDAY as holderBirthday, -- 投保人出生年月
holder.CUS_MST_CELL_NUM as holderMobileNo, -- 投保人手机号码
insured.CUS_MST_NAME as insuredName, -- 被保人姓名
insured.CUS_MST_ID as insuredId, -- 被保人编码
insured.CUS_MST_ID_NUM as insuredIdNo, -- 被保人编码
insured.CUS_MST_SEX as insuredSex, -- 被保人性别
insured.CUS_MST_BIRTHDAY as insuredBirthday, -- 被保人出生年月
insured.CUS_MST_CELL_NUM as insuredMobileNo, -- 被保人手机号码
m.MON025_405 as commission, -- 佣金
m.MON025_404 as commissionRate, -- 佣金率
m.MON025_004 as productId, -- 产品ID
m.MON025_401 as premium, -- 保费
m.MON025_101 as policyType, -- 保单类型
m.MON025_102 as payFrequency, -- 缴费频率
m.MON025_109 as payCommissionStatus -- 发佣状态
FROM ins001 policy INNER JOIN MON025 m on m.MON025_002 = policy.INS_MST_ID and m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1 AND m.mon025_108 = 'S01'-- 业务员id
inner join cus001 holder on policy.FK_CUS_PRO_ID = holder.CUS_MST_ID
inner join cus001 insured on policy.FK_CUS_PRO_ID = insured.CUS_MST_ID
inner join prd001 product on m.MON025_004 = product.PRD_MST_ID
inner join prd004 insurer on product.FK_PRD_SUP_ID = insurer.PRD_SUP_ID
WHERE policy.INS_MST_ID = #{orderNo,jdbcType=VARCHAR};