<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper">

  <resultMap id="tSalaryStandardMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard">
    <id property="id" column="ID"/>
    <result property="deptId" column="DEPT_ID"/>
    <result property="deptName" column="DEPT_NAME"/>
    <result property="deptNo" column="DEPT_NO"/>
    <result property="settlementAmount" column="SETTLEMENT_AMOUNT"/>
    <result property="belongDeptId" column="BELONG_DEPT_ID"/>
    <result property="belongDeptCode" column="BELONG_DEPT_CODE"/>
    <result property="settlementMonth" column="SETTLEMENT_MONTH"/>
    <result property="formType" column="FORM_TYPE"/>
    <result property="remark" column="REMARK"/>
    <result property="salaryMonth" column="SALARY_MONTH"/>
    <result property="moneyFrom" column="MONEY_FROM"/>
    <result property="status" column="STATUS"/>
    <result property="submitTime" column="SUBMIT_TIME"/>
    <result property="deleteFlag" column="DELETE_FLAG"/>
    <result property="auditUser" column="AUDIT_USER"/>
    <result property="auditTime" column="AUDIT_TIME"/>
    <result property="auditRemark" column="AUDIT_REMARK"/>
    <result property="province" column="PROVINCE"/>
    <result property="city" column="CITY"/>
    <result property="town" column="TOWN"/>
    <result property="type" column="TYPE"/>
    <result property="ownNums" column="OWN_NUMS"/>
    <result property="ownMoney" column="OWN_MONEY"/>
    <result property="ownRemark" column="OWN_REMARK"/>
    <result property="haveSalaryFlag" column="HAVE_SALARY_FLAG"/>
    <result property="haveSpecialFlag" column="HAVE_SPECIAL_FLAG"/>
    <result property="haveSalaryRemark" column="HAVE_SALARY_REMARK"/>
    <result property="haveSpecialRemark" column="HAVE_SPECIAL_REMARK"/>
    <result property="submitRemark" column="SUBMIT_REMARK"/>
    <result property="createBy" column="CREATE_BY"/>
    <result property="createName" column="CREATE_NAME"/>
    <result property="createTime" column="CREATE_TIME"/>
    <result property="updateBy" column="UPDATE_BY"/>
    <result property="updateTime" column="UPDATE_TIME"/>
    <result property="unitId" column="UNIT_ID"/>
    <result property="unitName" column="UNIT_NAME"/>
    <result property="unitNo" column="UNIT_NO"/>
    <result property="sendTime" column="SEND_TIME"/>
    <result property="sendMonth" column="SEND_MONTH"/>
    <result property="invoiceTitle" column="INVOICE_TITLE"/>
    <result property="specialNums" column="SPECIAL_NUMS"/>
    <result property="specialMoney" column="SPECIAL_MONEY"/>
    <result property="salaryNums" column="SALARY_NUMS"/>
    <result property="salaryMoney" column="SALARY_MONEY"/>
    <result property="repeatMoney" column="REPEAT_MONEY"/>
    <result property="repeatNums" column="REPEAT_NUMS"/>
    <result property="isRepeat" column="IS_REPEAT"/>
    <result property="repeatRemark" column="REPEAT_REMARK"/>
	<result property="orderId" column="ORDER_ID"/>
	<result property="bpoFlag" column="BPO_FLAG"/>
	<result property="applyNo" column="APPLY_NO"/>
	<result property="incomeStartTime" column="INCOME_START_TIME"/>
	<result property="incomeEndTime" column="INCOME_END_TIME"/>
	<result property="issueStatus" column="ISSUE_STATUS"/>
	<result property="isDiff" column="IS_DIFF"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.DEPT_ID,
                a.DEPT_NAME,
                a.DEPT_NO,
                a.SETTLEMENT_AMOUNT,
                a.BELONG_DEPT_ID,
                a.BELONG_DEPT_CODE,
                a.SETTLEMENT_MONTH,
                a.FORM_TYPE,
                a.REMARK,
                a.SALARY_MONTH,
                a.MONEY_FROM,
                a.STATUS,
                a.SUBMIT_TIME,
                a.DELETE_FLAG,
                a.AUDIT_USER,
                a.AUDIT_TIME,
                a.AUDIT_REMARK,
                a.PROVINCE,
                a.CITY,
                a.TOWN,
                a.TYPE,
                a.OWN_NUMS,
                a.OWN_MONEY,
                a.OWN_REMARK,
                a.HAVE_SALARY_FLAG,
                a.HAVE_SALARY_REMARK,
                a.HAVE_SPECIAL_FLAG,
                a.HAVE_SPECIAL_REMARK,
                a.SUBMIT_REMARK,
                a.CREATE_BY,
                a.CREATE_NAME,
                a.CREATE_TIME,
                a.UPDATE_BY,
                a.UPDATE_TIME,
                a.UNIT_ID,
                a.UNIT_NAME,
                a.UNIT_NO,
                a.SEND_TIME,
                a.SEND_MONTH,
                a.SPECIAL_NUMS,
                a.SPECIAL_MONEY,
                a.SALARY_NUMS,
                a.SALARY_MONEY,
                a.REPEAT_MONEY,
                a.REPEAT_NUMS,
                a.IS_REPEAT,
                a.REPEAT_REMARK,
				a.INVOICE_TITLE,
				a.ORDER_ID,
				a.BPO_FLAG,
				a.APPLY_NO,
				a.INCOME_START_TIME,
				a.INCOME_END_TIME,
				a.ISSUE_STATUS,
				a.IS_DIFF
    </sql>
    <sql id="tSalaryStandard_where">
        <if test="tSalaryStandard != null">
			<if test="tSalaryStandard.id != null and tSalaryStandard.id.trim() != ''">
				AND a.ID = #{tSalaryStandard.id}
			</if>
			<if test="tSalaryStandard.deptId != null and tSalaryStandard.deptId.trim() != ''">
				AND a.DEPT_ID = #{tSalaryStandard.deptId}
			</if>
			<if test="tSalaryStandard.orderId != null and tSalaryStandard.orderId.trim() != ''">
				AND a.ORDER_ID = #{tSalaryStandard.orderId}
			</if>
			<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
				AND a.DEPT_NAME like concat('%',#{tSalaryStandard.deptName},'%')
			</if>
			<if test="tSalaryStandard.invoiceTitle != null and tSalaryStandard.invoiceTitle.trim() != ''">
				AND a.INVOICE_TITLE like concat('%',#{tSalaryStandard.invoiceTitle},'%')
			</if>
			<if test="tSalaryStandard.deptNo != null and tSalaryStandard.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tSalaryStandard.deptNo}
			</if>
			<if test="tSalaryStandard.settlementAmount != null">
				AND a.SETTLEMENT_AMOUNT = #{tSalaryStandard.settlementAmount}
			</if>
			<if test="tSalaryStandard.belongDeptId != null and tSalaryStandard.belongDeptId.trim() != ''">
				AND a.BELONG_DEPT_ID = #{tSalaryStandard.belongDeptId}
			</if>
			<if test="tSalaryStandard.belongDeptCode != null and tSalaryStandard.belongDeptCode.trim() != ''">
				AND a.BELONG_DEPT_CODE = #{tSalaryStandard.belongDeptCode}
			</if>
			<if test="tSalaryStandard.settlementMonth != null and tSalaryStandard.settlementMonth.trim() != ''">
				AND a.SETTLEMENT_MONTH = #{tSalaryStandard.settlementMonth}
			</if>
			<if test="tSalaryStandard.formType != null and tSalaryStandard.formType.trim() != ''">
				AND a.FORM_TYPE = #{tSalaryStandard.formType}
			</if>
			<if test="tSalaryStandard.remark != null and tSalaryStandard.remark.trim() != ''">
				AND a.REMARK = #{tSalaryStandard.remark}
			</if>
			<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
				AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
			</if>
			<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() != ''">
				AND a.SALARY_MONTH >= #{tSalaryStandard.salaryMonthStart}
			</if>
			<if test="tSalaryStandard.salaryMonthEnd != null and tSalaryStandard.salaryMonthEnd.trim() != ''">
				AND a.SALARY_MONTH <![CDATA[<=]]> #{tSalaryStandard.salaryMonthEnd}
			</if>
			<if test="tSalaryStandard.moneyFrom != null">
				AND a.MONEY_FROM = #{tSalaryStandard.moneyFrom}
			</if>
			<if test="tSalaryStandard.status != null">
				AND a.STATUS = #{tSalaryStandard.status}
			</if>
			<if test="tSalaryStandard.submitTime != null">
				AND a.SUBMIT_TIME = #{tSalaryStandard.submitTime}
			</if>
			<if test="tSalaryStandard.deleteFlag != null">
				AND a.DELETE_FLAG = #{tSalaryStandard.deleteFlag}
			</if>
			<if test="tSalaryStandard.auditUser != null and tSalaryStandard.auditUser.trim() != ''">
				AND a.AUDIT_USER = #{tSalaryStandard.auditUser}
			</if>
			<if test="tSalaryStandard.auditTime != null">
				AND a.AUDIT_TIME = #{tSalaryStandard.auditTime}
			</if>
			<if test="tSalaryStandard.auditRemark != null and tSalaryStandard.auditRemark.trim() != ''">
				AND a.AUDIT_REMARK = #{tSalaryStandard.auditRemark}
			</if>
			<if test="tSalaryStandard.province != null">
				AND a.PROVINCE = #{tSalaryStandard.province}
			</if>
			<if test="tSalaryStandard.city != null">
				AND a.CITY = #{tSalaryStandard.city}
			</if>
			<if test="tSalaryStandard.town != null">
				AND a.TOWN = #{tSalaryStandard.town}
			</if>
			<if test="tSalaryStandard.type != null">
				AND a.TYPE = #{tSalaryStandard.type}
			</if>
			<if test="tSalaryStandard.ownNums != null">
				AND a.OWN_NUMS = #{tSalaryStandard.ownNums}
			</if>
			<if test="tSalaryStandard.ownMoney != null">
				AND a.OWN_MONEY = #{tSalaryStandard.ownMoney}
			</if>
			<if test="tSalaryStandard.specialNums != null">
				AND a.SPECIAL_NUMS = #{tSalaryStandard.specialNums}
			</if>
			<if test="tSalaryStandard.specialMoney != null">
				AND a.SPECIAL_MONEY = #{tSalaryStandard.specialMoney}
			</if>
			<if test="tSalaryStandard.salaryNums != null">
				AND a.SALARY_NUMS = #{tSalaryStandard.salaryNums}
			</if>
			<if test="tSalaryStandard.salaryMoney != null">
				AND a.SALARY_MONEY = #{tSalaryStandard.salaryMoney}
			</if>
			<if test="tSalaryStandard.repeatMoney != null">
				AND a.REPEAT_MONEY = #{tSalaryStandard.repeatMoney}
			</if>
			<if test="tSalaryStandard.repeatNums != null">
				AND a.REPEAT_NUMS = #{tSalaryStandard.repeatNums}
			</if>
			<if test="tSalaryStandard.ownRemark != null and tSalaryStandard.ownRemark.trim() != ''">
				AND a.OWN_REMARK = #{tSalaryStandard.ownRemark}
			</if>
			<if test="tSalaryStandard.submitRemark != null and tSalaryStandard.submitRemark.trim() != ''">
				AND a.SUBMIT_REMARK = #{tSalaryStandard.submitRemark}
			</if>
			<if test="tSalaryStandard.createBy != null and tSalaryStandard.createBy.trim() != ''">
				AND a.CREATE_BY = #{tSalaryStandard.createBy}
			</if>
			<if test="tSalaryStandard.createName != null and tSalaryStandard.createName.trim() != ''">
				AND a.CREATE_NAME = #{tSalaryStandard.createName}
			</if>
			<if test="tSalaryStandard.createTimeStart != null">
				AND a.CREATE_TIME <![CDATA[ >= ]]> #{tSalaryStandard.createTimeStart}
			</if>
			<if test="tSalaryStandard.createTimeEnd != null">
				AND a.CREATE_TIME <![CDATA[ <= ]]> #{tSalaryStandard.createTimeEnd}
			</if>
			<if test="tSalaryStandard.updateBy != null and tSalaryStandard.updateBy.trim() != ''">
				AND a.UPDATE_BY = #{tSalaryStandard.updateBy}
			</if>
			<if test="tSalaryStandard.updateTime != null">
				AND a.UPDATE_TIME = #{tSalaryStandard.updateTime}
			</if>
			<if test="tSalaryStandard.unitId != null and tSalaryStandard.unitId.trim() != ''">
				AND a.UNIT_ID = #{tSalaryStandard.unitId}
			</if>
			<if test="tSalaryStandard.unitName != null and tSalaryStandard.unitName.trim() != ''">
				AND a.UNIT_NAME = #{tSalaryStandard.unitName}
			</if>
			<if test="tSalaryStandard.unitNo != null and tSalaryStandard.unitNo.trim() != ''">
				AND a.UNIT_NO = #{tSalaryStandard.unitNo}
			</if>
			<if test="tSalaryStandard.sendMonth != null and tSalaryStandard.sendMonth.trim() != ''">
				AND a.SEND_MONTH = #{tSalaryStandard.sendMonth}
			</if>
			<if test="tSalaryStandard.applyNo != null and tSalaryStandard.applyNo.trim() != ''">
				AND a.APPLY_NO like concat('%',#{tSalaryStandard.applyNo},'%')
			</if>
			<if test="tSalaryStandard.isDiff != null and tSalaryStandard.isDiff.trim() != ''">
				AND a.IS_DIFF = #{tSalaryStandard.isDiff}
			</if>
        </if>
    </sql>
    <!--tSalaryStandard简单分页查询-->
    <select id="getTSalaryStandardPage" resultMap="tSalaryStandardMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
		<if test="tSalaryStandard.salaryMonthStart == null or tSalaryStandard.salaryMonthStart.trim() >= '202201' ">
			t_salary_standard a
		</if>
		<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() &lt; '202201' ">
             t_salary_standard_hro_2021 a
		</if>
        left join t_dept_see d on a.DEPT_NO = d.DEPT_NO
        <where>
            a.DELETE_FLAG = 0
            <!-- 薪资是否可查看 0 是 1否-->
            and (d.CAN_SEE = 0 OR d.id is null)
            <include refid="tSalaryStandard_where"/>
			<if test="tSalaryStandard.authSql != null and tSalaryStandard.authSql.trim() != ''">
				${tSalaryStandard.authSql}
			</if>
        </where>
		ORDER BY a.CREATE_TIME desc
    </select>
	<!--tSalaryStandard简单分页查询-->
	<select id="getTSalaryStandardPageApply" resultMap="tSalaryStandardMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM
		<if test="tSalaryStandard.salaryMonthStart == null or tSalaryStandard.salaryMonthStart.trim() >= '202201' ">
			t_salary_standard a
		</if>
		<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() &lt; '202201' ">
			t_salary_standard_hro_2021 a
		</if>
		<where>
			a.DELETE_FLAG = 0
			<!-- 薪资是否可查看 0 是 1否-->
			<include refid="tSalaryStandard_where"/>
			<if test="tSalaryStandard.authSql != null and tSalaryStandard.authSql.trim() != ''">
				${tSalaryStandard.authSql}
			</if>
		</where>
		ORDER BY a.CREATE_TIME desc
	</select>
	<!--tSalaryStandard简单分页查询-->
	<select id="getTSalaryStandardAuditPage" resultMap="tSalaryStandardMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_salary_standard a
		<where>
			a.STATUS in (1,2,5) AND a.DELETE_FLAG = 0
			<include refid="tSalaryStandard_where"/>
			ORDER BY CREATE_TIME DESC
		</where>
	</select>
	<resultMap id="salaryStandardExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo">
		<result property="status" column="STATUS"/>
		<result property="sendMonth" column="SEND_MONTH"/>
		<result property="deptName" column="DEPT_NAME"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="applyNo" column="APPLY_NO"/>
		<result property="settlementAmount" column="SETTLEMENT_AMOUNT"/>
		<result property="invoiceTitle" column="INVOICE_TITLE"/>
		<result property="createName" column="CREATE_NAME"/>
		<result property="salaryMonth" column="SALARY_MONTH"/>
		<result property="formType" column="FORM_TYPE"/>
		<result property="createTime" column="CREATE_TIME"/>
	</resultMap>
	<!--tSalaryStandard简单分页查询-->
	<select id="getSalaryStandardExport" resultMap="salaryStandardExportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo">
		SELECT
		case a.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '发送成功' when 5 then '审核不通过' when 6 then '确认不通过' when 10 then '发送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' end as STATUS,
		a.SEND_MONTH,
		a.DEPT_NAME,
		a.DEPT_NO,
		a.APPLY_NO,
		a.SETTLEMENT_AMOUNT,
		a.ID,
		a.DEPT_ID,
		a.BELONG_DEPT_ID,
		a.BELONG_DEPT_CODE,
		a.SETTLEMENT_MONTH,
		a.INVOICE_TITLE,
		a.CREATE_NAME,
		a.SALARY_MONTH,
		case a.FORM_TYPE when 0 then '薪资' when 1 then '绩效' when 2 then '其他' when 3 then '劳务费' when 4 then '稿酬' end as FORM_TYPE,
		a.CREATE_TIME
		FROM
		     <if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
				t_salary_standard a
			</if>
			<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
				t_salary_standard_hro_2021 a
			</if>
		LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
		<where>
			a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
			<include refid="where_export"/>
			<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
				${searchVo.authSql}
			</if>
			ORDER BY a.CREATE_TIME desc
			<if test="searchVo != null">
				<if test="searchVo.limitStart != null">
					limit #{searchVo.limitStart},#{searchVo.limitEnd}
				</if>
			</if>
		</where>
	</select>
	<!--tSalaryStandard简单分页查询-->
	<select id="getSalaryStandardExportCount"  resultType="java.lang.Integer">
		SELECT
		count(1)
		FROM
		<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
			t_salary_standard a
		</if>
		<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
			t_salary_standard_hro_2021 a
		</if>
		LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
		<where>
			a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
			<include refid="where_export"/>
			<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
				${searchVo.authSql}
			</if>
		</where>
	</select>
	<sql id="where_page">
		<if test="tSalaryStandard != null">
			<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
				AND a.DEPT_NAME like concat('%',#{tSalaryStandard.deptName},'%')
			</if>
			<if test="tSalaryStandard.deptNo != null and tSalaryStandard.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tSalaryStandard.deptNo}
			</if>
			<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
				AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
			</if>
			<!--<if test="tSalaryStandard.status == null">
				AND (a.STATUS = 1 OR a.STATUS = 2 OR a.STATUS = 5)
			</if>-->
			<if test="tSalaryStandard.status != null">
				AND a.STATUS = #{tSalaryStandard.status}
			</if>
		</if>
	</sql>
	<sql id="where_export">
		<if test="idList != null and idList.size>0">
			AND a.id in
			<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
				#{idStr}
			</foreach>
		</if>
		<if test="searchVo != null">
			<if test="searchVo.deptName != null and searchVo.deptName.trim() != ''">
				AND a.DEPT_NAME like concat('%',#{searchVo.deptName},'%')
			</if>
			<if test="searchVo.deptNo != null and searchVo.deptNo.trim() != ''">
				AND a.DEPT_NO = #{searchVo.deptNo}
			</if>
			<if test="searchVo.applyNo != null and searchVo.applyNo.trim() != ''">
				AND a.APPLY_NO like concat('%',#{searchVo.applyNo},'%')
			</if>
			<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
				AND a.SALARY_MONTH = #{searchVo.salaryMonth}
			</if>
			<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() != ''">
				AND a.SALARY_MONTH >= #{searchVo.salaryMonthStart}
			</if>
			<if test="searchVo.salaryMonthEnd != null and searchVo.salaryMonthEnd.trim() != ''">
				AND a.SALARY_MONTH <![CDATA[<=]]> #{searchVo.salaryMonthEnd}
			</if>
			<if test="searchVo.createTimeStart != null">
				AND a.CREATE_TIME <![CDATA[ >= ]]> #{searchVo.createTimeStart}
			</if>
			<if test="searchVo.createTimeEnd != null">
				AND a.CREATE_TIME <![CDATA[ <= ]]> #{searchVo.createTimeEnd}
			</if>
			<!--<if test="searchVo.status == null">
				AND (a.STATUS = 1 OR a.STATUS = 2 OR a.STATUS = 5)
			</if>-->
			<if test="searchVo.status != null">
				AND a.STATUS = #{searchVo.status}
			</if>
			<if test="searchVo.createName != null and searchVo.createName.trim() != ''">
				AND a.CREATE_NAME = #{searchVo.createName}
			</if>
		</if>
	</sql>

	<!-- 获取当日最大的编码 -->
	<select id="getMaxSalaryCode" resultType="java.lang.String">
		SELECT ifnull(max(right(e.APPLY_NO,4)),0) APPLY_NO FROM t_salary_standard e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
	</select>

</mapper>
