Commit 69f10b0b authored by hongguangwu's avatar hongguangwu

优化查询条件

parent 915ebcc3
......@@ -132,90 +132,90 @@
</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.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>
......@@ -322,25 +322,8 @@
<include refid="Base_Column_List"/>
FROM t_salary_standard a
<where>
1=1
AND a.DELETE_FLAG = 0
<if test="tSalaryStandard != null">
<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
AND a.DEPT_NAME = #{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>
a.STATUS in (1,2,5) AND a.DELETE_FLAG = 0
<include refid="tSalaryStandard_where"/>
ORDER BY CREATE_TIME DESC
</where>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment