|
@@ -26,6 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="reservationNumber" column="reservation_number" />
|
|
<result property="reservationNumber" column="reservation_number" />
|
|
<result property="filename" column="filename" />
|
|
<result property="filename" column="filename" />
|
|
<result property="userUnit" column="user_unit" />
|
|
<result property="userUnit" column="user_unit" />
|
|
|
|
+ <!--关联属性的映射关系-->
|
|
|
|
+ <!-- column: 对应的外键。 -->
|
|
|
|
+ <!-- <collection property="tInvoiceWorkcontentList" ofType="TInvoiceWorkcontent" column="id"
|
|
|
|
+ select="getWorkcontentList"></collection>-->
|
|
|
|
+
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="TInvoiceBookingworkticketVo" id="TInvoiceBookingworkticketResultVo">
|
|
<resultMap type="TInvoiceBookingworkticketVo" id="TInvoiceBookingworkticketResultVo">
|
|
@@ -45,23 +50,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="bookingticketId" column="id" />
|
|
<result property="bookingticketId" column="id" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+ <resultMap type="TInvoiceWorkcontent" id="TInvoiceWorkcontentResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
|
+ <result property="createrCode" column="creater_code" />
|
|
|
|
+ <result property="createdate" column="createdate" />
|
|
|
|
+ <result property="updaterCode" column="updater_code" />
|
|
|
|
+ <result property="updatedate" column="updatedate" />
|
|
|
|
+ <result property="workType" column="work_type" />
|
|
|
|
+ <result property="riskLevel" column="risk_level" />
|
|
|
|
+ <result property="workDescription" column="work_description" />
|
|
|
|
+ <result property="workPeopleNumber" column="work_people_number" />
|
|
|
|
+ <result property="guardianUnit" column="guardian_unit" />
|
|
|
|
+ <result property="estimateWorktime" column="estimate_worktime" />
|
|
|
|
+ <result property="bookingticketId" column="bookingticket_id" />
|
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
|
+ <result property="reservationNumber" column="reservation_number" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
<sql id="selectTInvoiceBookingworkticketVo">
|
|
<sql id="selectTInvoiceBookingworkticketVo">
|
|
select d.id, d.work_unit, d.work_area, d.unit_number, d.floor_location, d.work_start_time, d.work_end_time, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.contact, d.phonenumber, d.status, d.dept_id, d.user_mg ,d.user_unit,s.dept_name,d.filename,d.reservation_number from t_invoice_bookingworkticket d
|
|
select d.id, d.work_unit, d.work_area, d.unit_number, d.floor_location, d.work_start_time, d.work_end_time, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.contact, d.phonenumber, d.status, d.dept_id, d.user_mg ,d.user_unit,s.dept_name,d.filename,d.reservation_number from t_invoice_bookingworkticket d
|
|
left join sys_dept s on s.dept_id = d.dept_id
|
|
left join sys_dept s on s.dept_id = d.dept_id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
+ <sql id="selectTInvoiceWorkcontentVo">
|
|
|
|
+ select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.work_type, d.risk_level, d.work_description, d.work_people_number, d.guardian_unit, d.estimate_worktime, d.bookingticket_id, d.dept_id ,d.reservation_number,s.dept_name from t_invoice_workcontent d
|
|
|
|
+ left join sys_dept s on s.dept_id = d.dept_id left join t_invoice_bookingworkticket b on d.bookingticket_id =b.id
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
<select id="selectTInvoiceBookingworkticketList" parameterType="TInvoiceBookingworkticket" resultMap="TInvoiceBookingworkticketResult">
|
|
<select id="selectTInvoiceBookingworkticketList" parameterType="TInvoiceBookingworkticket" resultMap="TInvoiceBookingworkticketResult">
|
|
<include refid="selectTInvoiceBookingworkticketVo"/>
|
|
<include refid="selectTInvoiceBookingworkticketVo"/>
|
|
<where>
|
|
<where>
|
|
- <if test="workUnit != null "> and work_unit = #{workUnit}</if>
|
|
|
|
- <if test="workArea != null "> and work_area = #{workArea}</if>
|
|
|
|
- <if test="unitNumber != null "> and unit_number = #{unitNumber}</if>
|
|
|
|
- <if test="floorLocation != null "> and floor_location = #{floorLocation}</if>
|
|
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="workArea != null and workArea != ''"> and work_area = #{workArea}</if>
|
|
|
|
+ <if test="unitNumber != null and unitNumber != ''"> and unit_number = #{unitNumber}</if>
|
|
|
|
+ <if test="floorLocation != null and floorLocation != ''"> and floor_location = #{floorLocation}</if>
|
|
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
|
|
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
|
|
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if>
|
|
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if>
|
|
- <if test="createrCode != null "> and creater_code = #{createrCode}</if>
|
|
|
|
|
|
+ <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
|
|
<if test="createdate != null "> and createdate = #{createdate}</if>
|
|
<if test="createdate != null "> and createdate = #{createdate}</if>
|
|
- <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
|
|
|
|
|
|
+ <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
|
|
<if test="updatedate != null "> and updatedate = #{updatedate}</if>
|
|
<if test="updatedate != null "> and updatedate = #{updatedate}</if>
|
|
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
|
|
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
|
|
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
|
|
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
|
|
@@ -71,6 +100,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="userUnit != null "> and user_unit = #{userUnit}</if>
|
|
<if test="userUnit != null "> and user_unit = #{userUnit}</if>
|
|
<if test="reservationNumber != null "> and reservation_number = #{reservationNumber}</if>
|
|
<if test="reservationNumber != null "> and reservation_number = #{reservationNumber}</if>
|
|
<if test="filename != null and filename != ''"> and filename like concat(concat('%', #{filename}), '%')</if>
|
|
<if test="filename != null and filename != ''"> and filename like concat(concat('%', #{filename}), '%')</if>
|
|
|
|
+ <if test="workType != null "> and b.work_type = #{workType}</if>
|
|
|
|
+ and d.del_flag = 0
|
|
|
|
+ </where>
|
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
|
+ ${params.dataScope}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 新的list方法 -->
|
|
|
|
+ <select id="selectTInvoiceWorkcontentList" parameterType="TInvoiceBookingworkticket" resultMap="TInvoiceWorkcontentResult">
|
|
|
|
+ <include refid="selectTInvoiceWorkcontentVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="createrCode != null "> and creater_code = #{createrCode}</if>
|
|
|
|
+ <if test="createdate != null "> and createdate = #{createdate}</if>
|
|
|
|
+ <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
|
|
|
|
+ <if test="updatedate != null "> and updatedate = #{updatedate}</if>
|
|
|
|
+ <if test="workType != null "> and work_type = #{workType}</if>
|
|
|
|
+ <!-- <!– <if test="riskLevel != null "> and risk_level = #{riskLevel}</if>–>
|
|
|
|
+ <if test="workDescription != null and workDescription != ''"> and work_description = #{workDescription}</if>
|
|
|
|
+ <if test="workPeopleNumber != null "> and work_people_number = #{workPeopleNumber}</if>
|
|
|
|
+ <if test="guardianUnit != null and guardianUnit != ''"> and guardian_unit = #{guardianUnit}</if>
|
|
|
|
+ <if test="estimateWorktime != null and estimateWorktime != ''"> and estimate_worktime = #{estimateWorktime}</if>
|
|
|
|
+ <if test="bookingticketId != null "> and bookingticket_id = #{bookingticketId}</if>
|
|
|
|
+ <if test="reservationNumber != null and reservationNumber != ''"> and reservation_number = #{reservationNumber}</if>
|
|
|
|
+ <if test="deptId != null "> and dept_id = #{deptId}</if>-->
|
|
|
|
+ <if test="workUnit != null and workUnit != ''"> and b.work_unit = #{workUnit}</if>
|
|
|
|
+ <if test="workArea != null and workArea != ''"> and b.work_area = #{workArea}</if>
|
|
|
|
+ <if test="floorLocation != null and floorLocation != ''"> and b.floor_location = #{floorLocation}</if>
|
|
|
|
+ <if test="workStartTime != null "> and b.work_start_time = #{workStartTime}</if>
|
|
|
|
+ <if test="workEndTime != null "> and b.work_end_time = #{workEndTime}</if>
|
|
|
|
+ <if test="contact != null and contact != ''"> and b.contact = #{contact}</if>
|
|
|
|
+ <if test="phonenumber != null and phonenumber != ''"> and b.phonenumber = #{phonenumber}</if>
|
|
and d.del_flag = 0
|
|
and d.del_flag = 0
|
|
</where>
|
|
</where>
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
@@ -89,6 +149,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
and d.del_flag = 0
|
|
and d.del_flag = 0
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!-- <select id="getWorkcontentList" resultType="TInvoiceWorkcontent" parameterType="int">
|
|
|
|
+ SELECT
|
|
|
|
+ b.id ,b.work_description, b.work_type , b.bookingticket_id
|
|
|
|
+ FROM t_invoice_workcontent b
|
|
|
|
+ <where>
|
|
|
|
+ b.bookingticket_id = #{id}
|
|
|
|
+ <if test="workType != null "> and work_type = #{workType}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>-->
|
|
|
|
+
|
|
<insert id="insertTInvoiceBookingworkticket" parameterType="TInvoiceBookingworkticket" useGeneratedKeys = "true" keyProperty = "id">
|
|
<insert id="insertTInvoiceBookingworkticket" parameterType="TInvoiceBookingworkticket" useGeneratedKeys = "true" keyProperty = "id">
|
|
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
SELECT t_bookingworkticket_seq.NEXTVAL as id FROM DUAL
|
|
SELECT t_bookingworkticket_seq.NEXTVAL as id FROM DUAL
|